グラフのメモリラベル​をlabelsを使わ​ずに整数部の​表示桁​数を指定する方​法に​ついて

1 次查看(过去 30 天)
K_S_
K_S_ 2024-1-29
评论: K_S_ 2024-1-30
下記の質問と質問内容は同じですが,欲しい回答ではなかったので質問します。
他に,整数部の表示桁数を指定する(正確に求めているものを言うと,指数表示を止める)方法はありますでしょうか。
連続でグラフプロットするため,自動で調整する機能が欲しい次第ですが,下記は直接使えないですよね?。
https://jp.mathworks.com/matlabcentral/answers/2047477-y
  2 个评论
Dyuman Joshi
Dyuman Joshi 2024-1-29
You can change the ticks and tick labels.
It would be better if you could share more information as to what you are working with and what is the expected output.
K_S_
K_S_ 2024-1-30
2次遅れ系のステップ応答の立ち上がりから静定までを10ファイルに分割してデータを取得しています。
そのため,値の範囲はファイルごとに異なります。
ファイルを読み込み,グラフプロットする処理を10ループしています。
10個のグラフが出来上がってから,1つずつグラフのYTickLabel を自分で設定し直すのは非効率的なため避けたいと考えています。

请先登录,再进行评论。

回答(2 个)

交感神経優位なあかべぇ
座標軸が持つ各軸オブジェクトのExponentが指数値なので、この値を0にすることで、指数表示を消すことができます。
x = 1:5;
y = [100001 100002 100003 100004 100005];
plot(x, y);
haxes = gca;
haxes.YAxis.Exponent = 0;
  2 个评论
Dyuman Joshi
Dyuman Joshi 2024-1-29
How is this different than the answer posted on the linked thread (which OP has already tried and is not satisfied with)?
交感神経優位なあかべぇ
すみません。リンク先の回答をよく確認してませんでした。
全く同じでしたね...

请先登录,再进行评论。


Hiroshi Iwamura
Hiroshi Iwamura 2024-1-29
编辑:Hiroshi Iwamura 2024-1-29
YTickLabel を自分で設定するのではダメなんですか?
x = 1:5;
y = [100001 100002 100003 100004 100005];
p=plot(x, y);
ax=gca;
ax.YTick = y;
ax.YTickLabel = string(y);

类别

Help CenterFile Exchange 中查找有关 2 次元および 3 次元プロット 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!