plot grid in background

5 vues (au cours des 30 derniers jours)
Matthias Pospiech
Matthias Pospiech le 21 Fév 2012
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...

Réponse acceptée

Matthias Pospiech
Matthias Pospiech le 4 Mar 2012

Plus de réponses (0)

Catégories

En savoir plus sur Data Acquisition Toolbox Supported Hardware dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by