Info
此问题已关闭。 请重新打开它进行编辑或回答。
Does axes() return anything?
1 次查看(过去 30 天)
显示 更早的评论
f2 = figure;
a1 = axes('Parent',f2);
What is a1?
1 个评论
Stephen23
2015-9-7
The axes documentation explains that the output is a handle to the axes object:
You can read more about graphics handles here:
回答(2 个)
Star Strider
2015-9-6
The ‘a1’ variable is a ‘handle’ to the axes object.
In (I hope) more understandable terms, it shows all the properties of the axes of ‘f2’. This is useful if you want to find out what they are, and more usefully, to change them after the figure was plotted. This is particularly important if you want to change the tick positions, tick labels, or other characteristics of the axes object.
To see all the properties, add this line after the ‘a’ assignment:
a1_detail = get(a1)
0 个评论
the cyclist
2015-9-6
Pure speculation here. Were you actually intending to return the parent object of f2? In that case you want
get(f2,'Parent')
or
f2.Parent
1 个评论
Walter Roberson
2015-9-6
Probably not. axes('Parent', f2) is the proper syntax for creating a new axes whose parent is f2 .
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!