
yyaxis で描画した Y 軸の太さを調整することはできますか?
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 21 Giu 2018
Modificato: MathWorks Support Team
il 28 Giu 2018
yyaxis 関数で両側に Y 軸のあるグラフを作成しています。
Y 軸の太さを調整したいのですが、Axes の LineWidth プロパティを変更すると、上下の枠の太さも変更されてしまいます。
%%サンプルデータ定義
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
%%YYAXIS による描画
figure(1)
% 左側の軸に対する描画
yyaxis left
plot(x,y1)
xlabel('Time (\musec)');
ylabel('Slow Decay'); % Y 軸ラベル
% 軸の編集
ha1 = gca;
ha1.LineWidth = 2; % Axes の枠全体が調整される

Risposta accettata
MathWorks Support Team
il 28 Giu 2018
Axes の LineWidth プロパティでは、Axes 全体のラインの太さが調整されますが、Axes の YAxis プロパティから両軸の NumericRuler オブジェクトを取得し、このオブジェクトの LineWidth プロパティを編集することで、両 Y 軸の太さのみを変更することが可能です。
%%サンプルデータ定義
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
%%YYAXIS による描画
figure(1)
% 左側の軸に対する描画
yyaxis left
plot(x,y1)
xlabel('Time (\musec)');
ylabel('Slow Decay'); % Y 軸ラベル
% 軸の編集
ha1 = gca;
h_yaxis = ha1.YAxis; % 左右 Y 軸のNumericRuler オブジェクトを取得(サイズ [2x1])
h_yaxis(1).LineWidth = 2; % 左側の Y 軸の太さを変更

0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Two y-axis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!