Figure: Move axis background above all graphics objects

Here is a simple code which produces the figure on the left:
figure; box on; hold on;
line([0,1],[0,1],'LineWidth',10);
scatter(1,0,100,'filled');
Is it possible to stack gray background above graphics objects to get the figure on the right?
Command "set(gca,'Layer','top')" set just the black axis above the objects but not the gray background.

 채택된 답변

Jan
Jan 2018년 7월 19일
Start with
figure;
axes('ClippingStyle', 'rectangle', ... % Crops the line already
'box', 'on', ...
'NextPlot', 'add'); % Equivalent to: hold on
line([0,1],[0,1],'LineWidth',10);
scatter(1,0,100,'filled');

댓글 수: 2

Thanks, that's what I was looking for. Unfortunately, it does not affect markers.
Jan
Jan 2018년 7월 20일
편집: Jan 2018년 7월 20일
I did not find a solution for the marker also. What about using line objects to simulate markers? You need a modified version of scatter.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

제품

릴리스

R2015a

질문:

2018년 7월 19일

편집:

Jan
2018년 7월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by