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

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)?
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 Exchange에서 Stem 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