when printing a figure matlab prints line that are not shown on screen

2 次查看(过去 30 天)
Hi i am trying to print a map. when i do set(gca,'Position',outpos,'box','off');
I see no frame around my map (pcolorm) but then when i print it the left and bottom lines appear
I even tried to manually set xcolor and ycolor, when they are being set to lets say blue the frame apears blue but once i try setting the to white the same black line appear. what do i do?
the code i am using:
fg=figure
set(gcf, 'renderer', 'zbuffer');
m1=axesm('mapprojection','mercator','MapLatLim',[31 34.5],'MapLonLim',[30 36],... 'frame','off','plabellocation',1,'mlabellocation',1,'parallellabel', 'on','meridianlabel','on','frame','on');
cb=colorbar('Location','east');
caxis([-.1 1.5]);
inpos=get(gca,'Position');
outpos=[.2 .015 inpos(3) inpos(4)];
set(gca,'Position',outpos,'box','off');
inpos=get(cb,'Position');
outpos=[.05 .2 inpos(3) inpos(4)*.9];
set(cb,'Position',outpos);
data2plot=surface_noriv(:,:,itime)-surface_nile_before(:,:,itime);
data2plot(fsm==0)=0/0;
pcolorm(latpom,lonpom,data2plot);
shading interp;
showaxes('off');
textm(31.5,35,num2str(itime*2),'FontName','Times',... 'FontWeight','Bold','FontSize',16);
filename=['/tmp/time' sprintf('%03d',itime) '.png']
saveas(fg,filename)

采纳的回答

David
David 2019-6-21
Set XColor and YColor to None:
set(gca,'XColor','none');
set(gca,'YColor','none');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Identification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by