Remove timestamps (date & time) that appear on every figure by default

Running Matlab R2021a on a MacBook Pro, I'm getting time stamps on every single figure by default.
Example output, with the offending timestamp on the lower left:
plot(rand(1,10))
I searched the Internet a few times and couldn't find anyone having the same problem as me. Too few people upgraded to R2021a, perhaps? Or maybe Mac-specific?
What I tried:
findobj(gcf, 'Type', 'text')
ans =
0×0 empty GraphicsPlaceholder array.
Eyeballing the gcf properties didn't turn up anything either, but lmk if you want the full output (I may post it as a comment).
Output with axis off:
I'm stumped!

6 Comments

>> gcf
ans =
Figure (1) with properties:
Number: 1
Name: ''
Color: [1 1 1]
Position: [200 200 840 425]
Units: 'pixels'
Show all properties
Alphamap: [1×64 double]
BeingDeleted: off
BusyAction: 'queue'
ButtonDownFcn: ''
Children: [1×1 Axes]
Clipping: on
CloseRequestFcn: 'closereq'
Color: [1 1 1]
Colormap: [256×3 double]
ContextMenu: [0×0 GraphicsPlaceholder]
CreateFcn: @figureCreateFcn
CurrentAxes: [1×1 Axes]
CurrentCharacter: '`'
CurrentObject: [0×0 GraphicsPlaceholder]
CurrentPoint: [0 0]
DeleteFcn: ''
DockControls: on
FileName: ''
GraphicsSmoothing: on
HandleVisibility: 'on'
Icon: ''
InnerPosition: [200 200 840 425]
IntegerHandle: on
Interruptible: on
InvertHardcopy: on
KeyPressFcn: ''
KeyReleaseFcn: ''
MenuBar: 'figure'
Name: ''
NextPlot: 'add'
Number: 1
NumberTitle: on
OuterPosition: [200 200 840 504]
PaperOrientation: 'portrait'
PaperPosition: [-1.5833 2.5486 11.6667 5.9028]
PaperPositionMode: 'auto'
PaperSize: [8.5000 11]
PaperType: 'usletter'
PaperUnits: 'inches'
Parent: [1×1 Root]
Pointer: 'arrow'
PointerShapeCData: [16×16 double]
PointerShapeHotSpot: [1 1]
Position: [200 200 840 425]
Renderer: 'opengl'
RendererMode: 'auto'
Resize: on
Scrollable: off
SelectionType: 'normal'
SizeChangedFcn: ''
Tag: ''
ToolBar: 'auto'
Type: 'figure'
Units: 'pixels'
UserData: []
Visible: on
WindowButtonDownFcn: ''
WindowButtonMotionFcn: ''
WindowButtonUpFcn: ''
WindowKeyPressFcn: ''
WindowKeyReleaseFcn: ''
WindowScrollWheelFcn: ''
WindowState: 'normal'
WindowStyle: 'normal'
XDisplay: 'Quartz'
Alphamap: [1×64 double]
BeingDeleted: off
BusyAction: 'queue'
ButtonDownFcn: ''
Children: [1×1 Axes]
Clipping: on
CloseRequestFcn: 'closereq'
Color: [1 1 1]
Colormap: [256×3 double]
ContextMenu: [0×0 GraphicsPlaceholder]
CreateFcn: @figureCreateFcn
CurrentAxes: [1×1 Axes]
CurrentCharacter: ''
CurrentObject: [0×0 GraphicsPlaceholder]
CurrentPoint: [0 0]
DeleteFcn: ''
DockControls: on
FileName: ''
GraphicsSmoothing: on
HandleVisibility: 'off'
Icon: ''
InnerPosition: [0 0 200 150]
IntegerHandle: on
Interruptible: on
InvertHardcopy: on
KeyPressFcn: ''
KeyReleaseFcn: ''
MenuBar: 'none'
Name: ''
NextPlot: 'add'
Number: 3
NumberTitle: on
OuterPosition: [0 0 200 150]
PaperOrientation: 'portrait'
PaperPosition: [2.8611 4.4583 2.7778 2.0833]
PaperPositionMode: 'auto'
PaperSize: [8.5000 11]
PaperType: 'usletter'
PaperUnits: 'inches'
Parent: [1×1 Root]
Pointer: 'arrow'
PointerShapeCData: [16×16 double]
PointerShapeHotSpot: [1 1]
Position: [0 0 200 150]
Renderer: 'opengl'
RendererMode: 'auto'
Resize: on
Scrollable: off
SelectionType: 'normal'
SizeChangedFcn: ''
Tag: ''
ToolBar: 'none'
Type: 'figure'
Units: 'pixels'
UserData: []
Visible: off
WindowButtonDownFcn: ''
WindowButtonMotionFcn: ''
WindowButtonUpFcn: ''
WindowKeyPressFcn: ''
WindowKeyReleaseFcn: ''
WindowScrollWheelFcn: ''
WindowState: 'normal'
WindowStyle: 'normal'
XDisplay: 'Quartz'
That is bizarre, indeed...no Mac here so no can try anything specific to it.
I'll just note that more than likely the object is a child of the axes, not the figure.
What does
hAx=gca;
hAx.XAxis
return?
You have tried the brute force
clear classes
rehash
to wipe any spurious aliased functions and force a rebuild of the code cache, I presume?
Just tried clearing classes and rehashing -- same thing is happening.
I assumed this is not axes, because I tried "axis off" and that did nothing (the last image in the post above).
Here's the output of .XAxis:
NumericRuler with properties:
Limits: [-0.0500 0.0500]
Scale: 'linear'
Exponent: 0
TickValues: [-0.0500 0 0.0500]
TickLabelFormat: '%g'
Show all properties
Children: [0×0 GraphicsPlaceholder]
Color: [0.1500 0.1500 0.1500]
Direction: 'normal'
Exponent: 0
ExponentMode: 'auto'
FontAngle: 'normal'
FontName: 'Helvetica Neue'
FontSize: 13
FontSmoothing: on
FontWeight: 'normal'
HandleVisibility: 'off'
Label: [1×1 Text]
LabelHorizontalAlignment: 'center'
Limits: [-0.0500 0.0500]
LimitsChangedFcn: ''
LimitsMode: 'manual'
LineWidth: 0.5000
MinorTick: off
MinorTickValues: [-0.0400 -0.0300 -0.0200 -0.0100 0.0100 0.0200 0.0300 0.0400]
MinorTickValuesMode: 'auto'
Parent: [1×1 Axes]
Scale: 'linear'
TickDirection: 'in'
TickDirectionMode: 'auto'
TickLabelFormat: '%g'
TickLabelInterpreter: 'tex'
TickLabelRotation: 0
TickLabelRotationMode: 'auto'
TickLabels: {3×1 cell}
TickLabelsMode: 'auto'
TickLength: [0.0100 0.0250]
TickValues: [-0.0500 0 0.0500]
TickValuesMode: 'auto'
Visible: on
NumericRuler with properties:
That's what I was curious about -- checking that it wasn't somehow generating a DatetimeRuler axes object instead of NumericRuler -- that's the one that does put out a time string.
Is this a new install; has this done this from the first or is it a new symptom?
Do you have any earlier releases installed or have you had an earlier release for which, if have, I presume doesn't have the problem?
I think this is worthy a support call on install/startup issues if it is a new installation; I'd recommend that first before submitting a bug report.
Thanks for the response! It's a new install on a completely fresh Mac OS Big Sur 11.4 system; I don't have an earlier release, so I can't check if it's an issue there.
So my suggestion turned out to be the correct one to follow?

Sign in to comment.

 Accepted Answer

I speculate that you just might have a groot property set. Something like
get(groot,'DefaultAxesXLabel')
ans =
0×0 empty GraphicsPlaceholder array.
=====
After further discussion, the key to this situation was to use
functions( get(groot, 'defaultFigureCreateFcn'))
to track down a function that had been set by a software package the user was using.

14 Comments

Am I simply to run the command after any plot? I get the following:
>> get(groot,'DefaultAxesXLabel ')
Error using matlab.ui.Root/get
Unrecognized property XLabel for class Axes.
You put in a space after the word Label before the ' . The ' should be directly after the final letter.
Interesting idea, Walter, but with a new downloaded install, seems unlikely Egor would have managed to have done.
I thought I'd try out the idea and see if can duplicate the symptom, but I can't figure out a syntax which would set the default label to the current time string as he's showing. Could set it to a fixed date string, but not how to get a function callback that way.
I may be just not familiar enough with setting the root properties, though, I've never messed with them all that much; just a couple of minor tweaks of constants.
Oops, you're right.
>> get(groot,'DefaultAxesXLabel')
ans =
0×0 empty GraphicsPlaceholder array.
get(groot, 'Default')
ans = struct with fields:
defaultFigurePosition: [671 661 577 433] defaultFigurePaperPositionMode: 'auto' defaultFigureColor: [1 1 1] defaultFigureVisible: off defaultFigureToolBar: 'none' defaultFigureMenuBar: 'none'
might give some ideas.
>> get(groot, 'Default')
ans =
struct with fields:
defaultFigurePosition: [200 200 840 425]
defaultFigurePaperPositionMode: 'auto'
defaultFigureVisible: on
defaultFigureToolBar: 'auto'
defaultFigureMenuBar: 'figure'
defaultTextFontName: 'Helvetica Neue'
defaultTextFontSize: 14
defaultAxesFontName: 'Helvetica Neue'
defaultAxesFontSize: 14
defaultFigureColor: [1 1 1]
defaultFigureCreateFcn: @figureCreateFcn
Ah, that figureCreateFcn might be setting properties.
Do you have any idea how to look inside that function, Walter?
Try
which -all figureCreateFcn
if it's hidden or private that won't show it, of course.
After that, one can always resort to grep to find where the string might be located in the massive chain of stuff MATLAB installs. And with all the toolboxes you have, it's gargantuan.
Looks like it's hidden or private.
Not sure about the latter course ':D
I dunno about Mac OS utilities; with the Linux-like heritage I'd guess there's one.
You could always try the club of
set(groot,'defaultFigureCreateFcn','remove')
functions( get(groot, 'defaultFigureCreateFcn'))
should tell you the path to the function.
Wow... I actually found it. It's a custom-made function written by someone whose code I'm working with. Includes this gem:
set(groot, 'DefaultFigureCreateFcn', @figureCreateFcn)
...and then writes out the function.
Sorry for all the trouble guys! I pretty much never work with anyone else's code, so it didn't occur to me that someone would do such a thing XD
Yes, Walter, your answer is better. Could you update it with the functions command for locating it?

Sign in to comment.

More Answers (2)

While not the answer to the bizarre behavior, a workaround until that can be found and resolved would be
delete(findall(gcf,'type','textbox'))
right after creating a new plot.

6 Comments

Thanks, I thought I tried this but this time it worked! Just needs the parentheses closed.
You also must use findall and not findobj because the handle is hidden so findobj doesn't locate the offending textbox.
That was it! I was using findobj, you're right.
Ayup...and thanks for the catch for the missing closing paren; I just realized what was meant/missing.
Came back to just comment that I presume Steven will be back after the holiday weekend with more from the TMW end; if he doesn't for some reason, I'd submit a bug report for new install issue. Link to this Q? so don't have to repeat the diagnostics gone through.
Nothing here jumps out at me as a cause of this behavior. Please contact Technical Support and ask them to help determine what's causing those extra labels to appear, linking to this question to provide the Support staff the background and information about the investigation we started.
Will be interesting to hear what is the end resolution of this specter, indeed... :)

Sign in to comment.

Let's make sure first that no one has written functions that are taking precedence over the built-in graphics functions. Can you show us what each of these lines display in the Command Window?
which -all plot
which -all axes
which -all xlabel

8 Comments

Thanks for the response!
>> which -all plot
built-in (/Applications/MATLAB_R2021a.app/toolbox/matlab/graph2d/plot)
/Applications/MATLAB_R2021a.app/toolbox/matlab/datatypes/tabular/@tabular/tabular.m % tabular method
/Applications/MATLAB_R2021a.app/toolbox/matlab/polyfun/@alphaShape/plot.m % alphaShape method
/Applications/MATLAB_R2021a.app/toolbox/stats/classreg/@LinearModel/plot.m % LinearModel method
/Applications/MATLAB_R2021a.app/toolbox/matlab/polyfun/@polyshape/plot.m % polyshape method
/Applications/MATLAB_R2021a.app/toolbox/matlab/graphfun/@graph/plot.m % graph method
/Applications/MATLAB_R2021a.app/toolbox/matlab/graphfun/@digraph/plot.m % digraph method
/Applications/MATLAB_R2021a.app/toolbox/matlab/bigdata/@tall/plot.m % tall method
/Applications/MATLAB_R2021a.app/toolbox/curvefit/curvefit/@cfit/plot.m % cfit method
/Applications/MATLAB_R2021a.app/toolbox/curvefit/curvefit/@sfit/plot.m % sfit method
/Applications/MATLAB_R2021a.app/toolbox/wavelet/wavelet/@ntree/plot.m % ntree method
/Applications/MATLAB_R2021a.app/toolbox/wavelet/wavelet/@dtree/plot.m % dtree method
/Applications/MATLAB_R2021a.app/toolbox/wavelet/wavelet/@wdectree/plot.m % wdectree method
/Applications/MATLAB_R2021a.app/examples/wavelet/data/@wvtree/plot.m % wvtree method
/Applications/MATLAB_R2021a.app/examples/wavelet/data/@edwttree/plot.m % edwttree method
/Applications/MATLAB_R2021a.app/examples/wavelet/data/@rwvtree/plot.m % rwvtree method
/Applications/MATLAB_R2021a.app/toolbox/signal/signal/@dspdata/plot.m % dspdata method
/Applications/MATLAB_R2021a.app/toolbox/wavelet/wavedemo/@wvtree/plot.m % wvtree method
/Applications/MATLAB_R2021a.app/toolbox/wavelet/wavedemo/@edwttree/plot.m % edwttree method
/Applications/MATLAB_R2021a.app/toolbox/wavelet/wavedemo/@rwvtree/plot.m % rwvtree method
/Applications/MATLAB_R2021a.app/toolbox/coder/half/@half/plot.p % half method
/Applications/MATLAB_R2021a.app/toolbox/bioinfo/bioinfo/@phytree/plot.m % phytree method
/Applications/MATLAB_R2021a.app/toolbox/bioinfo/microarray/@clustergram/plot.m % clustergram method
/Applications/MATLAB_R2021a.app/toolbox/bioinfo/microarray/@HeatMap/plot.m % HeatMap method
/Applications/MATLAB_R2021a.app/toolbox/matlab/timeseries/@timeseries/plot.m % timeseries method
>> which -all axes
built-in (/Applications/MATLAB_R2021a.app/toolbox/matlab/graphics/axis/axes)
>> which -all xlabel
/Applications/MATLAB_R2021a.app/toolbox/matlab/graph2d/xlabel.m
None of those look to be out of place -- you do have several toolboxes I don't have but one still wouldn't think those would be the culprit.
Since Steven has seen this and it's a holiday weekend, I'd guess best/all that is to be done at the moment is wait until Tuesday when TMW gets back to work.
This is certainly bizarre behavior, however, agreed.
Oh! Just a thought -- is the datetime string selectable in the figure editor, by any chance?
You could try to save a .fig file and attach it and see if anybody can poke around in its content and find anything..
While Mac isn't as numerous as the other OS, there are enough users that it would seem to be unusual nobody else has reported an issue.
dpb's comment about "several toolboxes" pointed out to me that we haven't asked you what toolboxes you have installed. I wonder if you have a third-party toolbox installed that tries to set some default figure or axes properties on startup that affects the appearance of the window. Please post the list of products displayed by this command (replace your license number with stars or just remove it entirely.)
ver
Ah! That is a good thought, Steven..I didn't think about the 3rd party possibility earlier, either.
Thanks for the responses!
Yes, the timestamp is selectable! I'm attaching a .fig file.
My toolboxes:
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.10.0.1649659 (R2021a) Update 1
MATLAB License Number: unknown
Operating System: macOS Version: 11.4 Build: 20F71
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.10 (R2021a)
Simulink Version 10.3 (R2021a)
Audio Toolbox Version 3.0 (R2021a)
Bioinformatics Toolbox Version 4.15.1 (R2021a)
Computer Vision Toolbox Version 10.0 (R2021a)
Control System Toolbox Version 10.10 (R2021a)
Curve Fitting Toolbox Version 3.5.13 (R2021a)
DSP System Toolbox Version 9.12 (R2021a)
Database Toolbox Version 10.1 (R2021a)
Deep Learning Toolbox Version 14.2 (R2021a)
Embedded Coder Version 7.6 (R2021a)
Image Acquisition Toolbox Version 6.4 (R2021a)
Image Processing Toolbox Version 11.3 (R2021a)
Instrument Control Toolbox Version 4.4 (R2021a)
Lidar Toolbox Version 1.1 (R2021a)
MATLAB Coder Version 5.2 (R2021a)
MATLAB Compiler Version 8.2 (R2021a)
MATLAB Compiler SDK Version 6.10 (R2021a)
MATLAB Report Generator Version 5.10 (R2021a)
Mapping Toolbox Version 5.1 (R2021a)
Mixed-Signal Blockset Version 2.0 (R2021a)
Optimization Toolbox Version 9.1 (R2021a)
Parallel Computing Toolbox Version 7.4 (R2021a)
Partial Differential Equation Toolbox Version 3.6 (R2021a)
Reinforcement Learning Toolbox Version 2.0 (R2021a)
Signal Processing Toolbox Version 8.6 (R2021a)
Simulink 3D Animation Version 9.2 (R2021a)
Simulink Check Version 5.1 (R2021a)
Simulink Coder Version 9.5 (R2021a)
Simulink Compiler Version 1.2 (R2021a)
Simulink Control Design Version 5.7 (R2021a)
Simulink Coverage Version 5.2 (R2021a)
Simulink Design Optimization Version 3.9.1 (R2021a)
Simulink Design Verifier Version 4.5 (R2021a)
Simulink Desktop Real-Time Version 5.12 (R2021a)
Simulink PLC Coder Version 3.4 (R2021a)
Simulink Report Generator Version 5.10 (R2021a)
Simulink Requirements Version 1.7 (R2021a)
Simulink Test Version 3.4 (R2021a)
Stateflow Version 10.4 (R2021a)
Statistics and Machine Learning Toolbox Version 12.1 (R2021a)
Symbolic Math Toolbox Version 8.7 (R2021a)
Wavelet Toolbox Version 5.6 (R2021a)
>> hF=open('untitled.fig')
Undefined function handle.
hF =
Figure (1) with properties:
Number: 1
Name: ''
Color: [1 1 1]
Position: [1246 484 200 150]
Units: 'pixels'
Show all properties
>> hTxt=findall(hF,'type','textbox')
hTxt =
TextBox (03-Jul-2021 10:34:20) with properties:
String: '03-Jul-2021 10:34:20'
FontName: 'Helvetica Neue'
FontSize: 8
FontWeight: 'normal'
Color: [0 0 0]
BackgroundColor: 'none'
EdgeColor: [0 0 0]
LineStyle: 'none'
LineWidth: 0.5000
Position: [0 0 0.6025 0.1600]
Units: 'normalized'
Show all properties
>> hTxt.Parent
ans =
AnnotationPane
>>
When open the fig file on remote system, there's an undefined callback function buried in there somewhere -- it's probably the culprit.
If search including for objects which have been set as having hidden handles, then it shows up as above.
Probably with this info, TMW can delve into the bowels and figure out what/who is the culprit here.
Your list of Toolboxes plus having Simulink is far, far beyond my install which is only base MATLAB plus four or five basic toolboxes.
I guess one could begin by paring down the search path selectively to remove a sizable subset of those and see how far one has to go for the symptom to disappear, then do a binary search putting stuff back to find out when it reappears.
TMW probably have better ways to go at it...
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.9.0.1592791 (R2020b) Update 5
MATLAB License Number: xxxxx
Operating System: Microsoft Windows ...
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.9 (R2020b)
Curve Fitting Toolbox Version 3.5.12 (R2020b)
MATLAB Compiler Version 8.1 (R2020b)
Optimization Toolbox Version 9.0 (R2020b)
Signal Processing Toolbox Version 8.5 (R2020b)
Statistics and Machine Learning Toolbox Version 12.0 (R2020b)
>>
As can see, besides being a release earlier (I generally only do the b releases), there's a veritable plethora of possibilities beyond which I have that could be the bad boy...or, of course, it could also be an artifact somehow introduced in R2021a or unique to Mac.

Sign in to comment.

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Products

Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!