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

조회 수: 1 (최근 30일)
yair suari
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)

채택된 답변

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