How to retain a line on axes when plotting new line in MATLAB GUI?

1 回表示 (過去 30 日間)
Shameer Aslam
Shameer Aslam 2020 年 4 月 20 日
回答済み: Mehmed Saad 2020 年 4 月 20 日
I have 3 axes in my GUI. I have plotted a line on each of them using line(). Again I want to plot new set of line, retaining the previous lines. But as I am using line() again, it overwrites the previous lines. So, is there a way to retain the older lines while plotting new?

回答 (1 件)

Mehmed Saad
Mehmed Saad 2020 年 4 月 20 日
I know one method, maybe it is not the best but it worked for me
figure;
plot(1:100,'b.','LineWidth',20);hold on
imshow('cameraman.tif');hold on
plot(120:150,'r-','LineWidth',20);
Now i change the position of childrens in gca which will change the layer position
y = gca;
tmp_c = (y.Children);
order = [3 1 2];
y.Children = tmp_c(order);

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by