0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

plotlyで軸の数値が省略される(1000=K)問題の解決

Last updated at Posted at 2022-09-15

現状

以下のグラフだと縦軸が400Kや200Kになってしまう。
実際の値は400,000 や200,000であり、そのままの値で表示したい場合がある。
image.png

解決策

以下のコードを入れるのみ。

fig.update_yaxes(
    tickformat="d",
)

image.png

eや%表記がしたい場合は以下参照
tickformatのところを変えるといろいろできそう。

ちなみに

軸の刻み幅を変えたい場合はdtickを追加する。

fig.update_yaxes(
    tickformat="d",
    dtick=100000
)

image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?