コンターマップのカラーバーのラベルの変更
Afficher commentaires plus anciens
SubplotとFor文で、カラーバーのラベル名を順番に設定しようとしましたがうまくいきません。
2×2のコンターマップのカラーバーの変数を変えようとしましたが、
最後(2,2)セルのグラフのカラーバーの変数だけが順番に更新され、
他のセル位置のグラフのカラーバーの変数は固定されてしまいます。
すみませんが、ご教授いただけると幸いです。
コードは、下記になります。
for i=1:4
~~~~~省略
Cbar(i)=colorbar;
Cbar(i).Label.String=char(Variable(Vz(i)));←Variableはラベル名が格納された行列です。
2 commentaires
Takumi
le 5 Août 2020
質問の内容を再現してみましたが,正常に更新されます.
エラーを完全に再現できるコードを掲示していただけますとより良い回答ができます.
[X,Y,Z] = peaks;
Variable = {'label1','label2','label3','label4'};
for i=1:4
figure(1)
subplot(2,2,i);
contour(X,Y,Z,i*10);
Cbar(i)=colorbar;
Cbar(i).Label.String = Variable{i};
end
Shinij Kumagai
le 5 Août 2020
Réponse acceptée
Plus de réponses (1)
Shinij Kumagai
le 7 Août 2020
0 votes
Catégories
En savoir plus sur 等高線図 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!