27
24

More than 5 years have passed since last update.

matplotlibで座標軸を調整する

Posted at

nbviewerに表示例を載せましたのでついてに見てください。

matplotlib.pyplot.axis(*v, **kwargs)

Convenience method to get or set axis properties.

Calling with no arguments:

``````axis()
``````

returns the current axes limits [xmin, xmax, ymin, ymax].:

``````axis(v)
``````

sets the min and max of the x and y axes, with v = [xmin, xmax, ymin, ymax].:
v = [xmin, xmax, ymin, ymax]を引数として呼べはx,yの最大・最小をそれぞれ設定します。

``````axis('off')
``````

turns off the axis lines and labels.:

``````axis('equal')
``````

changes limits of x or y axis so that equal increments of x and y have the same length; a circle is circular.:
xあるいはyの上限・下限を調整して同じ座標値の増分が同じ長さになるように調整します。

``````axis('scaled')
``````

achieves the same result by changing the dimensions of the plot box instead of the axis data limits.:
(上限・下限はそのままで)表示する領域を調整する事で('equal'の場合と)同じ効果を得ます。

``````axis('tight')
``````

changes x and y axis limits such that all data is shown. If all data is already shown, it will move it to the center of the figure without modifying (xmax - xmin) or (ymax - ymin). Note this is slightly different than in MATLAB.:

``````axis('image')
``````

is ‘scaled’ with the axis limits equal to the data limits.:
データの最大・最小を使用した上でさらに'scaled'の効果を得ます。

``````axis('auto')
``````

and:

``````axis('normal')
``````

are deprecated. They restore default behavior; axis limits are automatically scaled to make the data fit comfortably within the plot box.
は廃止予定です。これらはデフォルトの設定を回復します。データがプロット領域にうまく入るようにします。

if `len(*v)==0`, you can pass in xmin, xmax, ymin, ymax as kwargs selectively to alter just those limits without changing the others.
`len(*v)==0`の場合はxmin, xmax, ymin, ymaxを選択的にキーワード引数として与える事ができます。この時与えられなかった設定はそのままで与えた設定を反映させられます。

The xmin, xmax, ymin, ymax tuple is returned

xlim(), ylim()
For setting the x- and y-limits individually.

27
24
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
27
24