Can I specify the stacking order of graphics objects in MATLAB?

15 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日
コメント済み: Walter Roberson 2019 年 3 月 17 日
I would like to specify the stacking order of graphics objects in MATLAB.

採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日
It is possible to modify the stacking order of an object's children by setting the Children property to a permutation of itself. However, the new value must contain the same handles as the old value. For example:
%Create a patch and a line plot with the line plot overlaying the patch
h=patch([0 1 0 1], [0 1 1 0], 'r');
x=.5*ones(10,1);
y=linspace(0,1, 10);
hold on
hp=plot(x,y);
%Returns handles to the patch and line objects
chi=get(gca, 'Children')
%Reverse the stacking order so that the patch overlays the line
set(gca, 'Children',flipud(chi))
A similar concept applies to the tabbing order of the UICONTROLS. For more information and an example of changing the tabbing order, see the Related Solution:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by