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

1 回表示 (過去 30 日間)
Sakuni Samarakoon
Sakuni Samarakoon 2023 年 4 月 24 日
コメント済み: Sakuni Samarakoon 2023 年 4 月 24 日
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')

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 4 月 24 日
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')
  1 件のコメント
Sakuni Samarakoon
Sakuni Samarakoon 2023 年 4 月 24 日
An error like this is shown here.
Error using subplot (line 244)
Requires valid axes handle for input.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by