Global Index (short | long) | Local contents | Local Index (short | long)
This file contains commands that will generate the figures in Section 4 of the tutorial
This script calls | |
---|---|
% Clear the workspace clear % Load the regression maps cd /home/disk/tao/dvimont/matlab/Wallace load CT_regmaps.mat figure_tall(1); clf; % Opens a tall figure on the screen. %%%%%%%%%%%%%%%%%%%%%% Contour Map %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Open a subplot to plot the map in: global_axes(5, 3.6, 0, 0, 1.5); % In place of global_axes and subplot2, subplot2(1,1); % one can use the standard subplot % command. % Set global variables global_latlon(lat, lon, [0 360 -90 90]); % Define a map axis in the current subplot map_axis('giso'); % Contour the data - positive solid, negative dashed (_pn) map_contour_pn(regmap1, 0.2, 'nozeroline'); % Draw a map underneath the data fill_landmap('under'); % Draw grid lines gridm on % Tighten map to fit the subplot tightmap2 % Add a title, and some labels - % Note that the default axes fontsize (set in define_globals.m, % in the startup.m file) is 8 title('Regression of Surface Temperature onto the CTI', 'fontsize', 10); xlabel('Contour Interval: 0.2', 'fontsize', 9); % Now, add new subplot to plot the CTI in global_axes(5, 0.75, 0, 0, 3.6+1.5+0.5); subplot2(1,1) p1 = plot(1948:1/12:(2000+11/12), ct, '-k'); axis([1945 2005 -1.5 2.5]); set(gca, 'XTick', [1945:5:2005], 'YTick', -2:2); grid on ylabel('\circC', 'fontsize', 9); xlabel('CTI', 'fontsize', 9); cd ~/matlab/Wallace/Figs print -dpsc2 contour_fig1.ps %%%%%%%%%%%%%%%%%%%%%% Labelled Contours %%%%%%%%%%%%%%%%%%%%%%%%% % Now, redo this, using labelled contours figure_landscape(1); clf; global_axes(9, 6, 0, 0, 1.5); subplot2(1,1); % Make map axes, and contour regmap2. Note that XAX and YAX are % already set from the previous plot. Otherwise, we would have % to set them by: % global_latlon(lat, lon, [0 360 -90 90]); map_axis('giso'); [c, h] = map_contour(regmap2, 0.15); % Shade regions where the correlation exceeds 0.5 shade_solid(abs(cormap1), 0.5); % Add a grey [.5 .5 .5] landmask OVER the data fill_landmap('over', 0.5*[1 1 1]); gridm on framem2; % Add solid border around map tightmap2; % Tighten map to axis limits set(gca, 'visible', 'off'); % Get rid of outside box % Now, add contour labels to the map. This may be done in one of % three ways, each of which is useful at different times. Two % are commented out, but try each. % cs = clabelm(c, [-3:.15:3]); % Label random lines with +'s % cs = clabelm(c, h, [-3:.3:3]); % Only label every other line cs = clabelm(c, h, 'manual'); % user specified labelling set(cs, 'fontsize', 8); % Change font using handles % Now, because we've set(gca, 'visible', 'off'), we need to % set 'visible' 'on' for titles and labels. We could also do this % by assigning a handle, then changing the handle's properties. title('SST Regressed onto the CTI', 'visible', 'on', 'fontsize', 10); xlabel('Contour Interval: 0.15 \circC std^-^1', 'visible', 'on'); cd ~/matlab/Wallace/Figs print -dpsc2 contour_fig2.ps %%%%%%%%%%%%%%%%%%%%%%%%%% Color plot with SLP contoured %%%%%% load /home/disk/tao/dvimont/matlab/Wallace/CT_SLP_regmaps.mat % Open subplot and such figure_tall(1); clf; global_axes(5.5, 3.6, 0, 0, 1.5); global_latlon(lat, lon, [0 360 -90 90]); subplot2(1,1); cla; map_axis('giso'); % Start by shading the SST map at altitude z = -0.5; h = map_surface(regmap2, -0.5*ones(size(regmap2))); caxis([-.75 .75]); % This scales the colormap such that data in % regmap2 that equals -0.75 or 0.75 is assigned % the minimum (or maximum) color in the color % pallate % Contour SLP over the top - this should end up at altitude % z = 0, so it's over the SST map. hold on; [c2, h2] = map_contour_pn(regmap2_slp, 0.25); hold off; set(h2, 'linewidth', 2); % Now, add a landmask at z=-0.25 so it's over the SST, but under % the SLP. fill_landmap(-0.25, 0.7); % And finally, touch up the plot gridm on; framem2; tightmap2; set(gca, 'visible', 'off'); t1 = title(['\bf SST (shaded) and SLP (contoured) regressed on ' ... 'standardized CTI'], 'visible', 'on', 'fontsize', 10); x1 = xlabel('SLP Contour Interval: 0.25 hPa std^-^1', ... 'visible', 'on', 'fontsize', 9); % Add colorbar to right side of plot cb = colorbar2('vertical'); set(cb, 'YTick', [-0.6:.3:0.6]); cb_y1 = get(cb, 'ylabel'); set(cb_y1, 'string', 'SST: \circC std^-^1', ... 'rotation', -90, 'fontsize', 9); % If you don't like the position of the ylabel on the colorbar, change % it with the 'set(cb_y1, 'Position', [x y z])' command. cd ~/matlab/Wallace/Figs print -dpsc2 shading_fig1.ps %%%%%%%%%%%%%%%%%%%%%%%%%%%% MONOCHROMATIC MAPS %%%%%%%%%%%%%%%%%%%%% clear cd ~/matlab/Wallace load SFCT_mean_var.mat % Open subplot and such figure_landscape(1); clf; global_axes(5, 6, 0, 0, 1.5); global_latlon(lat, lon, [0 360 20 90]); subplot2(1,1); cla; ma = map_axis('stereo', [90 0]); % Start with shading the variance map h = map_surface_interp(sqrt(varsfct_win), ... -0.5*ones(size(varsfct_win))); % Change the color scale so it's reasonable colormap(jet(64)); caxis([0 1.5]); % Now, fill in areas where sfct_win < -1.8 with a % light shading - over water, this is where ice will % be found. global XAX YAX FRAME; hold on; [iceline, h2] = map_contour(sfct_win, [-1.8 -1.8]); iceline(:,1) = NaN; % help contours for reasoning here set(h2, 'visible', 'off'); hold off; h3 = patchm(iceline(2,:), iceline(1,:), -0.4, [1 1 1]); set(h3, 'edgecolor', 'none'); % Fill in land fill_landmap(0.25, 0.8); % Add climatological SFC airt hold on; [c4,h4] = map_contour_pn(sfct_win, [0:2.5:35], 'zeroline'); hold off; % Label some SFCT contours cs = clabelm(c4, h4, 'manual'); set(cs, 'fontsize', 8); % shrink to fit framem tightmap set(gca, 'visible', 'off'); gridm on; % Add colorbar - define axes handle, then switch to it cb = colorbar2('horiz'); axes(cb); axis([[0 1.5] get(cb, 'YLim')]); set(gca, 'XTick', 0:.25:1.5); xlabel('StDev SFC AIRT: \circC', 'fontsize', 9) % switch back to map axes axes(ma); xlabel('Contour: SFC AIRT (2.5 \circC)', 'visible', 'on', ... 'fontsize', 9); title('\bf NDJFMA SFC AIRT: StDev (shaded), Mean (contoured)', ... 'visible', 'on', 'fontsize', 10); cd ~dvimont/matlab/Wallace/Figs print -dpsc2 NDJFMA_SAT_maps.ps