y軸ラベルの1段目と2段目で色を変更する方法について
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
y軸ラベルの1段目を赤色,2段目を青色(例のコードですと,2000を赤色・1000を青色)のようにしたいです。
1段目・2段目とも同じ色にはできるのですが,別々に色を指定することは出来るのでしょうか?
figure
plot((1:10).^2)
ylabel({2000;1000})
0 Kommentare
Antworten (1)
Musashi Ito
am 8 Apr. 2020
ylabel 関数では文字ごとの色を指定することはできなさそうですね。どうしても表示したい場合は、例えば text 関数を使用して説明のテキストとして 2 つ追加する等の工夫が必要かなと思います。
figure
plot((1:10).^2)
text(0.01,50,'2000','Color',[1 0 0],'Rotation',90,'FontSize',12)
text(0.3,50,'1000','Color',[0 0 1],'Rotation',90,'FontSize',12)
※ figure のウィンドウサイズが変わると座標の間隔が変わるため体裁が崩れるみたいです・・・
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!