MATLAB Answers

0

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

yair suari さんによって質問されました 2012 年 1 月 5 日
最新アクティビティ David
さんによって 回答されました 2019 年 6 月 21 日
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)

  0 件のコメント

サインイン to comment.

1 件の回答

回答者: David
2019 年 6 月 21 日
 採用された回答

Set XColor and YColor to None:
set(gca,'XColor','none');
set(gca,'YColor','none');

  0 件のコメント

サインイン to comment.



Translated by