Remove timestamps (date & time) that appear on every figure by default
Show older comments
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
Egor Ananyev
on 3 Jul 2021
dpb
on 3 Jul 2021
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?
Egor Ananyev
on 3 Jul 2021
dpb
on 3 Jul 2021
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.
Egor Ananyev
on 3 Jul 2021
Walter Roberson
on 6 Jul 2021
So my suggestion turned out to be the correct one to follow?
Accepted Answer
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
Egor Ananyev
on 4 Jul 2021
dpb
on 4 Jul 2021
You also must use findall and not findobj because the handle is hidden so findobj doesn't locate the offending textbox.
Egor Ananyev
on 4 Jul 2021
dpb
on 5 Jul 2021
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.
Steven Lord
on 5 Jul 2021
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.
dpb
on 6 Jul 2021
Will be interesting to hear what is the end resolution of this specter, indeed... :)
Steven Lord
on 3 Jul 2021
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
Egor Ananyev
on 3 Jul 2021
dpb
on 4 Jul 2021
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.
dpb
on 4 Jul 2021
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.
Steven Lord
on 4 Jul 2021
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
dpb
on 4 Jul 2021
Ah! That is a good thought, Steven..I didn't think about the 3rd party possibility earlier, either.
Egor Ananyev
on 4 Jul 2021
dpb
on 4 Jul 2021
>> 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...
dpb
on 5 Jul 2021
>> 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.
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!