グラフの軸の指数表示について

ライブスクリプトでX、Y軸を指数表示にしたいのですがうまく出力されません。
コードは、以下のようにシンプルなコードです。
x = 0:0.01:1;
y = x;
plot(x,y);
ax = gca;
ax.XAxis.Exponent = -2;
ax.YAxis.Exponent = -2;
しかし、表示されるグラフの軸は以下のようになってしまいます。
10^(-2)でスケールされたX軸Y軸を出力したいのですがどのように対処すべきか教示ください。

2 comentarios

Kojiro Saito
Kojiro Saito el 12 de Feb. de 2024
MATLAB OnlineでもデスクトップのMATLABでもR2023bで試したのですが、再現できません。。
x = 0:0.01:1;
y = x;
plot(x,y);
ax = gca;
ax.XAxis.Exponent = -2;
ax.YAxis.Exponent = -2;
一度「ビュー」タブの「すべての出力をクリア」でプロットを消してから実行してみてはいかがでしょうか?
Sugawara Takashi
Sugawara Takashi el 12 de Feb. de 2024
ご検証いただきましてありがとうございます。
R2023b Update6にアップデートしたところ正しく表示されました。

Iniciar sesión para comentar.

 Respuesta aceptada

Hiroshi Iwamura
Hiroshi Iwamura el 12 de Feb. de 2024

0 votos

R2024aPre のライブエディターでだけそうなりましたが、Updateしたら直りました
途中で unsigned になってしまっていたのではないでしょうか
s = "0xfffffffe"; % int32 の -2
hex2dec([s + "s32"])
ans = -2
int32(hex2dec([s + "u32"]))
ans = int32 2147483647

3 comentarios

Sugawara Takashi
Sugawara Takashi el 12 de Feb. de 2024
ご検証いただきましてありがとうございます。
R2023b Update6にアップデートしたところ正しく表示されました。
Kojiro Saito
Kojiro Saito el 13 de Feb. de 2024
Sugawara Takashi
Sugawara Takashi el 13 de Feb. de 2024
ありがとうございます。次回からはバグレポートの方も参考にさせていただきたいと思います。

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Versión

R2023b

Etiquetas

Community Treasure Hunt

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

Start Hunting!