Clear Filters
Clear Filters

How to to get a figure to fill a box or get a box around the figure

3 views (last 30 days)
Im not sure how better to describe this in the title but I am creating an average precipitation map of sourthern america. My code works fine right now and I have attached it below, however really no matter what i try I cant get the figure to fill the box. I either want the figure to fill the box or have the box wrap around the figure, I just dont want the white space around the map. My code is below and an example of the current output is below that. Thanks!
% % precip_lat=ncread('','lat');
% % precip_lon=ncread('','lon');
% % precip_time=ncread('','time');
% % precip=ncread('','precip');
% %%
% % precip_WP_monthly=precip(:,:,1:12);
% % [x,y]=meshgrid(precip_lon(:),precip_lat(:));
% % x=double(x);
% % y=double(y);
% close all
h3ax=axesm('MapProjection','mercator','MapLatLimit',[-60 -30],'MapLonLimit', [-90 -60],...
gridm on
% framem on
% h2=surfm(y,x,sum(precip_WP_monthly(:,:,:),3)'./12);
% h2=surfm(y,x,precip_WP_monthly(:,:,1)' - precip_WP_monthly(:,:,7)');
% h2=surfm(y,x,precip_WP_monthly(:,:,6)'-precip_WP_monthly(:,:,8)');
h3=surfm(y,x,((precip_WP_monthly(:,:,12)' + precip_WP_monthly(:,:,1)' + precip_WP_monthly(:,:,2)')/3));
shading interp;
clim manual
clim ([-1, 5])
%caxis ([-7 7])
% colorbar
cmap = flipud(cmocean('diff')) ;
load coastlines
geoshow(-46.4053, 282.6758,'DisplayType','Point','Marker','d','MarkerFaceColor',[1 0 0],...
title('Austral Winter Average Percipitation, 1981-2010', "FontSize", 12)

Accepted Answer

Chunru on 27 Mar 2024

More Answers (0)





Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!