How to plot subplots in one figure to showing 4 seasons of chlorophyll-a data?

1 view (last 30 days)
I have 4 Chlorophyll-a datasets as18*3, 18*5,18*2 and 18*2 double datasets. I want to plot subplots in one figure to showing 4 seasons of chlorophyll-a data in Matlab. I tried to 1 plot. But after run this code in Matlab the map was displayed in shifted up and down and not displaying colors. How to resolve this?
% Create a new figure
figure;
% Add the NEM subplot
subplot(2,2,1);
imagesc(lon,lat,NEM);
colormap jet;
hold on
% color axis limits
caxis ([0 2]);
m_coast('patch',[.7 .7 .7]);
m_grid;
colorbar
title('Northeast monsoon')

Answers (1)

Walter Roberson
Walter Roberson on 24 Apr 2023
Try
% Create a new figure
fig = figure;
% Add the NEM subplot
ax = subplot(fig, 2, 2, 1);
imagesc(ax, lon, lat, NEM);
colormap(ax, jet);
hold(ax, 'on');
m_coast('patch', [.7 .7 .7], 'Parent', ax);
m_grid('axes', ax);
% color axis limits
caxis(ax, [0 2]);
colorbar(ax)
title(ax, 'Northeast monsoon')

Tags

Community Treasure Hunt

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

Start Hunting!