タグ

ブックマーク / natsutan.hatenablog.com (1)

  • matplotlibで軸を制御する - ぱたへね

    グラフを書くときの軸の設定です。 プロット範囲をmatplotlibに任せるには、'auto'、'equal'、'tight'、'scaled'のどれかを引数にして、axis関数を呼び出します。 xticks,yticksを使えば、座標軸に文字列を使ったり、グリッドの間隔を指定できます。 サンプル画像 ソースファイル # -*- coding: utf-8 -*- from pylab import * R = 1.2 A = 1.2 I1 = arange(0,2*pi,0.01) I2 = arange(0,4*pi,0.01) axis_options = ['auto', 'equal', 'tight', 'scaled'] def plot_circle(n): opt = axis_options[n] subplot(2,2,n) title(opt) plot(A * s

    matplotlibで軸を制御する - ぱたへね
  • 1