軸ラベルの表示を、0,π/4,π/2,π,・・・ のようにしたいのですが、どのようにすればいいのですか?
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 25 Oct 2013
Réponse apportée : MathWorks Support Team
le 25 Oct 2013
軸ラベルの表示を、0,π/4,π/2,π,・・・ のようにしたいのですが、どのようにすればいいのですか?
Réponse acceptée
MathWorks Support Team
le 25 Oct 2013
軸のプロパティの"FontName"を"Symbol"に変更することで表示が可能です。
(例)正弦波をプロットのx軸ラベルを0,π/4,π/2,π,・・・ のように表示します。
下記コマンドを実行してください。
%正弦波の作成
t=0:pi/50:2*pi;
plot(t/pi,sin(t))
%x軸ラベルの設定
%アルファベットの"p"がフォントSymbolの"π"に相当
str={'0','p/4','p/2','3p/4','p','5p/4','3p/2','7p/4','2p'}
set(gca,'FontName','symbol','xtick',[0:.25:2],'xticklabel',str)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 座標軸の外観 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!