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

11 次查看(过去 30 天)
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 个评论
Egor Ananyev
Egor Ananyev 2021-7-3
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.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2021-7-5
编辑:Walter Roberson 2021-7-6
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 个评论
Egor Ananyev
Egor Ananyev 2021-7-6
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
Egor Ananyev
Egor Ananyev 2021-7-6
Yes, Walter, your answer is better. Could you update it with the functions command for locating it?

请先登录,再进行评论。

更多回答(2 个)

dpb
dpb 2021-7-4
编辑:dpb 2021-7-5
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 个评论
Steven Lord
Steven Lord 2021-7-5
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
dpb 2021-7-6
Will be interesting to hear what is the end resolution of this specter, indeed... :)

请先登录,再进行评论。


Steven Lord
Steven Lord 2021-7-3
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 个评论
dpb
dpb 2021-7-4
>> 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
dpb 2021-7-5
>> 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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by