|
54 | 54 | figure; |
55 | 55 | hold on; |
56 | 56 | flag2D=false; |
57 | | - if gemini3d.sys.has_mapping() |
58 | | - ha=gca; |
59 | | -% axesm('MapProjection','Mercator','MapLatLimit',[-(abs(sourcemlat)+30),abs(sourcemlat)+30],'MapLonLimit',[sourcemlonplot-dmlon/2-10,sourcemlonplot+dmlon/2+10]) |
| 57 | + ha=gca; |
| 58 | + try |
| 59 | + % axesm('MapProjection','Mercator','MapLatLimit',[-(abs(sourcemlat)+30),abs(sourcemlat)+30],'MapLonLimit',[sourcemlonplot-dmlon/2-10,sourcemlonplot+dmlon/2+10]) |
60 | 60 | axesm('MapProjection','Mercator', ... |
61 | | - 'MapLatLimit', double([-(abs(sourcemlat)+dmlat/2+5),abs(sourcemlat)+dmlat/2+5]), ... |
62 | | - 'MapLonLimit', double([sourcemlonplot-dmlon/2-10,sourcemlonplot+dmlon/2+10])) |
| 61 | + MapLatLimit=double([-(abs(sourcemlat)+dmlat/2+5),abs(sourcemlat)+dmlat/2+5]), ... |
| 62 | + MapLonLimit=double([sourcemlonplot-dmlon/2-10,sourcemlonplot+dmlon/2+10])) |
63 | 63 | plotfun=@plot3m; |
64 | | - else |
65 | | - ha=gca; |
| 64 | + catch e |
| 65 | + mappingException(e) |
66 | 66 | plotfun=@plot3; %no mapping toolbox so we'll do normal plots - the annoying thing is that these should be lon,lat,alt so all the plots statements have to be switched |
67 | 67 | end |
68 | 68 | end |
|
101 | 101 | set(h,'LineWidth',LW,'Color',[0 0 0]); |
102 | 102 | ha=h; |
103 | 103 | else %this is a 3D grid and we can plot it on a map if the user has the appropriate toolbox(es) |
104 | | - if gemini3d.sys.has_mapping() |
| 104 | + |
| 105 | + try % Mapping Toolbox |
105 | 106 | % plots are done lat,lon,alt for plot3m |
106 | 107 | plotfun(mlat(:,1,1),mlon(:,1,1),alt(:,1,1),'LineWidth',LW); |
107 | 108 | plotfun(mlat(:,1,end),mlon(:,1,end),alt(:,1,end),altlinestyle,'LineWidth',LW); |
|
170 | 171 | z=squeeze(alt(end,end,ix3:xg.lx(3))); |
171 | 172 | plotfun(x,y,z,altlinestyle,'LineWidth',LW); |
172 | 173 |
|
173 | | - xlabel('magnetic longitude (deg.)'); |
174 | | - ylabel('magnetic latitude (deg.)'); |
175 | | - zlabel('altitidue (km)'); |
176 | | - else %plotting is done lon,lat,alt with plot3 |
| 174 | + catch e |
| 175 | + mappingException(e) |
| 176 | + |
| 177 | + %plotting is done lon,lat,alt with plot3 |
177 | 178 | plotfun(mlon(:,1,1),mlat(:,1,1),alt(:,1,1),'LineWidth',LW); |
178 | 179 | plotfun(mlon(:,1,end),mlat(:,1,end),alt(:,1,end),altlinestyle,'LineWidth',LW); |
179 | 180 | plotfun(mlon(:,end,1),mlat(:,end,1),alt(:,end,1),'LineWidth',LW); |
|
241 | 242 | z=squeeze(alt(end,end,ix3:xg.lx(3))); |
242 | 243 | plotfun(x,y,z,altlinestyle,'LineWidth',LW); |
243 | 244 |
|
244 | | - xlabel('magnetic latitude (deg.)'); |
245 | | - ylabel('magnetic longitude (deg.)'); |
246 | | - zlabel('altitidue (km)'); |
247 | 245 | end |
| 246 | + |
| 247 | + xlabel('magnetic longitude (deg.)'); |
| 248 | + ylabel('magnetic latitude (deg.)'); |
| 249 | + zlabel('altitude (km)'); |
| 250 | + |
248 | 251 | h=gca; %now go back and make all lines the same color... |
249 | 252 | % lline = numel(h.Children); |
250 | 253 | for iline=1:16 %the last three children are the surface and text label objects |
|
424 | 427 | h=polarplot(terr_theta,terr_r,'c:'); |
425 | 428 | set(h,'LineWidth',LW); |
426 | 429 | else |
427 | | - if gemini3d.sys.has_mapping() |
| 430 | + try % Mapping Toolbox |
428 | 431 | hold on; |
429 | 432 | %ax=axis; |
430 | 433 | coastlat = load('coastlines', 'coastlat').coastlat; |
|
441 | 444 | plotfun(mlatcoast,mloncoast,zeros(size(mlatcoast)),'b-','LineWidth',0.5); |
442 | 445 | setm(gca,'MeridianLabel','on','ParallelLabel','on','MLineLocation',10,'PLineLocation',10,'MLabelLocation',10,'PLabelLocation',10); |
443 | 446 | hold off; |
| 447 | + catch e |
| 448 | + mappingException(e) |
444 | 449 | end |
445 | 450 | view(270,35); |
446 | 451 | axis tight; |
|
0 commit comments