plot lines and stems behind the markers?

Hi, How can I put the plot lines and stems behind the markers?

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 10 月 21 日

0 投票

You can use uistack(). For example, consider this code
x = 1:10;
y = rand(1,10);
hold on
s = scatter(x, y, 'filled', 'SizeData', 100);
p = plot(x, y, 'LineWidth', 2);
the line will be over the scatter points. You can bring the scatter point on top using
uistack(s, 'top')

3 件のコメント

Sim
Sim 2020 年 10 月 21 日
Thanks a lot, in my specific case your solution works if I put both commands:
uistack(markers, 'top')
uistack(lines, 'bottom')
However, How can I do the same for a stem plot (stem lines and corresponding markers in the bottom half of this plot)?
Ameer Hamza
Ameer Hamza 2020 年 10 月 21 日
You can also get the handle of stem object and arrange it using uistack
s = stem(..)
Sim
Sim 2020 年 10 月 21 日
thanks a lot!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

質問済み:

Sim
2020 年 10 月 21 日

コメント済み:

Sim
2020 年 10 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by