LoginSignup
7
6

More than 5 years have passed since last update.

pylab で plot するときに、x軸の値を n 倍する

Posted at

matplotlib で プロットするときに、

  • 軸はそのまま自動で生成させたい。
  • でも軸のラベルは全部 10 倍にしたい

みたいなときは、 xticks でラベルと取ってきて、
それを編集して書き戻せば良い。

xticks, strs = pylab.xticks()
pylab.xticks(xticks, ["%d" % x for x in 10 * xticks])
7
6
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
7
6