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

1 Ansicht (letzte 30 Tage)
K_S_
K_S_ am 29 Jan. 2024
Kommentiert: K_S_ am 30 Jan. 2024
下記の質問と質問内容は同じですが,欲しい回答ではなかったので質問します。
他に,整数部の表示桁数を指定する(正確に求めているものを言うと,指数表示を止める)方法はありますでしょうか。
連続でグラフプロットするため,自動で調整する機能が欲しい次第ですが,下記は直接使えないですよね?。
https://jp.mathworks.com/matlabcentral/answers/2047477-y
  2 Kommentare
Dyuman Joshi
Dyuman Joshi am 29 Jan. 2024
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_ am 30 Jan. 2024
2次遅れ系のステップ応答の立ち上がりから静定までを10ファイルに分割してデータを取得しています。
そのため,値の範囲はファイルごとに異なります。
ファイルを読み込み,グラフプロットする処理を10ループしています。
10個のグラフが出来上がってから,1つずつグラフのYTickLabel を自分で設定し直すのは非効率的なため避けたいと考えています。

Melden Sie sich an, um zu kommentieren.

Antworten (2)

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

Melden Sie sich an, um zu kommentieren.


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

Kategorien

Mehr zu 2 次元および 3 次元プロット finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!