automatically subtitle subplots after their generation

2 ビュー (過去 30 日間)
Ehab Salahat
Ehab Salahat 2019 年 3 月 30 日
回答済み: Star Strider 2019 年 3 月 30 日
Imagine creating a matlab figure with several subplots and now the figure is generated. How can I assign a title for each subplot in this figure (after generating all subplots)? I am not interested in assigning a title for each while generating it. I am sure it can be done using figure handling but clear how to do so.

回答 (1 件)

Star Strider
Star Strider 2019 年 3 月 30 日
Try this:
figure
hs(1) = subplot(2,1,1);
plot(rand(20,1), rand(20,1), 'pg')
hs(2) = subplot(2,1,2);
plot(rand(20,1), rand(20,1), 'pr')
title(hs(1), 'Subplot 1')
title(hs(2), 'Subplot 2')
Experiment to get the result you want

カテゴリ

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