All available default settings for groot?

61 Ansichten (letzte 30 Tage)
lazymatlab
lazymatlab am 29 Jun. 2020
Beantwortet: Steven Lord am 29 Jun. 2020
Hello,
Today I've found that I can change the default order of line colors and line styles of multi-line plot using
set(groot, 'DefaultAxesColorOrder', newcolors)
set(groot, 'DefaultAxesLineStyleOrder', '-|:|.-')
% https://kr.mathworks.com/matlabcentral/answers/20187-how-to-change-the-standard-of-coloring-figures
So I digged a little bit further, and found I can also set stuff like
set(groot, 'defaultLineLineWidth', 2)
set(groot, 'defaultFigureColor', 'b')
% https://kr.mathworks.com/help/matlab/creating_plots/default-property-values.html
set(groot, 'DefaultFigureColormap', hot)
% https://kr.mathworks.com/help/matlab/ref/groot.html
set(groot, 'Units', 'normalized')
% https://kr.mathworks.com/help/matlab/ref/matlab.ui.root-properties.html
Is there any reference page that lists all available default settings for groot? I don't understand why those default settings are separated in several pages. I could not even find 'DefaultAxesColorOrder' except the answers page above.
Thank you.
Kang

Akzeptierte Antwort

Steven Lord
Steven Lord am 29 Jun. 2020
Those "properties" aren't properties of groot. See this documentation page for a description of that syntax for setting default property values for other Handle Graphics objects that will be created under groot in the future. Note that you can set the defaults at a more granular level too, setting the default for all Axes created in a figure without affecting Axes created in another figure as an example.
At least theoretically you can set the default property value for any settable property of a Handle Graphics this way. [I'm not aware of any exceptions.] Some may be more useful than others (setting the 'DefaultLineXData' at best won't do anything, and at worst could cause your attempt to create a line to issue a warning and not draw the line.)

Weitere Antworten (1)

Image Analyst
Image Analyst am 29 Jun. 2020
Type groot on the command line:
>> groot
ans =
Graphics Root with properties:
CurrentFigure: [0×0 GraphicsPlaceholder]
ScreenPixelsPerInch: 96
ScreenSize: [1 1 1920 1080]
MonitorPositions: [1 1 1920 1080]
Units: 'pixels'
Show all properties
CallbackObject: [0×0 GraphicsPlaceholder]
Children: [0×0 GraphicsPlaceholder]
CurrentFigure: [0×0 GraphicsPlaceholder]
FixedWidthFontName: 'Courier New'
HandleVisibility: 'on'
MonitorPositions: [1 1 1920 1080]
Parent: [0×0 GraphicsPlaceholder]
PointerLocation: [545 93]
ScreenDepth: 32
ScreenPixelsPerInch: 96
ScreenSize: [1 1 1920 1080]
ShowHiddenHandles: off
Tag: ''
Type: 'root'
Units: 'pixels'
UserData: []
  1 Kommentar
lazymatlab
lazymatlab am 29 Jun. 2020
Bearbeitet: lazymatlab am 29 Jun. 2020
Thank you for your answer. But I can't find some stuff like 'defaultAxesColorOrder' or 'defaultFigureColormap' from this list, even though they are available to be set using set(groot, ...).

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Animation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by