Changeset 19204
- Timestamp:
- 03/17/15 15:52:50 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/exp/exptool.m
r15333 r19204 16 16 % - markersize (default=7) 17 17 % - markeredgecolor (default='r') 18 % - nofigurecopy (default=0) do not copy current figure, this is needed on some plateform to avoid an offset in the figure 18 19 % 19 20 % Usage: … … 98 99 99 100 %get current figure 100 if ~isempty(get(0,'children')),%if there is already a figure (return the number of opened figures) 101 set(gcf,'Renderer','zbuffer'); %fixes a bug on Mac OS X (not needed in future Matlab version) 102 P=get(gcf,'position'); 103 F=getframe(gca); 104 F=F.cdata; 105 %get current axis 106 xlim=get(gca,'Xlim'); 107 ylim=get(gca,'Ylim'); 108 %recreate x_m and y_m 109 x_m=linspace(xlim(1),xlim(2),size(F,2)); 110 y_m=linspace(ylim(2),ylim(1),size(F,1)); %getframe reverse axis... 111 %plot the data in another figure 112 figure; set(gcf,'position',P); 113 imagesc(x_m,y_m,F); set(gca,'Ydir','normal'); 114 prevplot=1; 115 prevplot2=1; 101 nofigurecopy=getfieldvalue(options,'nofigurecopy',1); 102 if ~nofigurecopy, 103 if ~isempty(get(0,'children')),%if there is already a figure (return the number of opened figures) 104 set(gcf,'Renderer','zbuffer'); %fixes a bug on Mac OS X (not needed in future Matlab version) 105 P=get(gcf,'position'); 106 Fp=get(gca,'position'); 107 F=getframe(gca); 108 F=F.cdata; 109 %get current axis 110 xlim=get(gca,'Xlim'); 111 ylim=get(gca,'Ylim'); 112 %recreate x_m and y_m 113 x_m=linspace(xlim(1),xlim(2),size(F,2)); 114 y_m=linspace(ylim(2),ylim(1),size(F,1)); %getframe reverse axis... 115 %plot the data in another figure 116 figure; set(gcf,'position',P); 117 imagesc(x_m,y_m,F); set(gca,'Ydir','normal','Position',Fp,'Xlim',xlim,'Ylim',ylim); 118 prevplot=1; 119 prevplot2=1; 120 else 121 figure 122 prevplot=0; 123 prevplot2=0; 124 end 116 125 else 117 figure 118 prevplot=0; 119 prevplot2=0; 126 g=get(gca,'children'); 127 L=length(g); 128 prevplot=L; 129 prevplot2=L; 120 130 end 121 131 … … 348 358 349 359 %close window 350 close; 360 if ~nofigurecopy, 361 close; 362 end
Note:
See TracChangeset
for help on using the changeset viewer.