plot grid in background

조회 수: 12 (최근 30일)
Matthias Pospiech
Matthias Pospiech 2012년 2월 21일
I use the gridxy (<http://www.mathworks.com/matlabcentral/fileexchange/9973-gridxy-v2-2-feb-2008>) function (because the original grid can not be modified properly), which works very well.
But in this example the grid is painted in the foreground in the exported png:
figure(1); clf;
x = [0:0.1:10];
y = sin(xaxis*pi/2).*xaxis;
xtemp = [x(1) ; x(:) ; x(end)] ;
ytemp = [0 ; y(:) ; 0 ] ;
% plot
hplot = fill(xtemp,ytemp, 'b');
set(hplot, 'FaceColor' , [0.5, 0.5, 0.75])
set(hplot, 'EdgeColor' , [0, 0, 0.25])
hgrid = gridxy(get(gca,'XTick'),get(gca,'YTick'),'Color',[0.6 0.6 0.6],'Linestyle','--', 'LineWidth', 0.6);
print(gcf, '-r400', ['test' '.png'], '-dpng');
If I could attach the resulting png you would see the problem directly...

채택된 답변

Matthias Pospiech
Matthias Pospiech 2012년 3월 4일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by