Where to find a complete list of supported class names for 'set' command?

조회 수: 4 (최근 30일)
John
John 2015년 10월 29일
댓글: Yair Altman 2015년 10월 29일
I am trying to configure some default figure parameters in my startup.m file, however I can not find some of the appropriate classes and associated input options for using the set function.
For example, I would like to set the x, y and z axes label default font sizes to 18. Instead of writing
xlabel('x', 'FontSize', 18),
ylabel('y', 'FontSize', 18),
zlabel('z', 'FontSize', 18);
all fo the time, I would like to use something like
set(0, 'DefaultXlabelFontSize', 16) % this is obviously incorrect, just an example
in my startup file, but I can not find the list of classes that are supported by set. Can somebody point me to the location where I can find all of the valid class names along with all of the associated valid options for each class when using set? Thank you.

채택된 답변

Star Strider
Star Strider 2015년 10월 29일
See Default Property Values. This has to do with graphics properties only, and it is only possible to set some of them.
  댓글 수: 3
Star Strider
Star Strider 2015년 10월 29일
My pleasure.
As with everything else, it’s probably necessary to experiment to see what works. Another quite useful resource is Yair Altman’s Undocumented MATLAB site. (Bookmark it!) It might have some workarounds that let you do what you want.
Yair Altman
Yair Altman 2015년 10월 29일
I actually wrote an article about all this back in early 2013: http://undocumentedmatlab.com/blog/getting-default-hg-property-values
That post still referred to the old HG1 that was in use at that time, but the basic mechanism has not changed much, and get(0,'factory') still works to this day (R2015b).

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

TastyPastry
TastyPastry 2015년 10월 29일
I don't think such documentation exists. The issue is that set() is an extremely generic. Its function differs wildly with what you're trying to use it for. For example, plots and uicontrol have many different options/parameters which can be changed using set(). As MATLAB adds or deletes new functionality such as uitable(), uipanel(), etc., the function of set() will expand or contract.
If you're looking for all the things you can use set() for in regards to plotting, the plot() documentation will tell you what you can use set() for when the target is a plot, axes, etc.
  댓글 수: 1
John
John 2015년 10월 29일
편집: John 2015년 10월 29일
I agree that if I want to change something in plot() the help documentation lists features associated with plot() that can be changed. However, let's say I want to set my default axes limits to 'tight'. This is done using
set(0,'DefaultAxesXLimSpec','tight') % set axes tight
set(0,'DefaultAxesYLimSpec','tight')
set(0,'DefaultAxesZLimSpec','tight')
Nowhere in the axis() documentation will you find this information. I had to search rigorously through many websites before I found somebody that had posted this. So, the documentation is lacking for many options/parameters.
I am specifically looking for setting default values for: 1) x, y, and z label font sizes, 2) legend font sizes and 3) title font sizes

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by