MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / axis

Method axis

lib/matplotlib/axes/_base.py:2129–2265  ·  view source on GitHub ↗

Convenience method to get or set some axis properties. Call signatures:: xmin, xmax, ymin, ymax = axis() xmin, xmax, ymin, ymax = axis([xmin, xmax, ymin, ymax]) xmin, xmax, ymin, ymax = axis(option) xmin, xmax, ymin, ymax = axis(**kwargs)

(self, arg=None, /, *, emit=True, **kwargs)

Source from the content-addressed store, hash-verified

2127 self.set_xbound(x_trf.inverted().transform([x0, x1]))
2128
2129 def axis(self, arg=None, /, *, emit=True, **kwargs):
2130 """
2131 Convenience method to get or set some axis properties.
2132
2133 Call signatures::
2134
2135 xmin, xmax, ymin, ymax = axis()
2136 xmin, xmax, ymin, ymax = axis([xmin, xmax, ymin, ymax])
2137 xmin, xmax, ymin, ymax = axis(option)
2138 xmin, xmax, ymin, ymax = axis(**kwargs)
2139
2140 Parameters
2141 ----------
2142 xmin, xmax, ymin, ymax : float, optional
2143 The axis limits to be set. This can also be achieved using ::
2144
2145 ax.set(xlim=(xmin, xmax), ylim=(ymin, ymax))
2146
2147 option : bool or str
2148 If a bool, turns axis lines and labels on or off. If a string,
2149 possible values are:
2150
2151 ================ ===========================================================
2152 Value Description
2153 ================ ===========================================================
2154 'off' or `False` Hide all axis decorations, i.e. axis labels, spines,
2155 tick marks, tick labels, and grid lines.
2156 This is the same as `~.Axes.set_axis_off()`.
2157 'on' or `True` Do not hide all axis decorations, i.e. axis labels, spines,
2158 tick marks, tick labels, and grid lines.
2159 This is the same as `~.Axes.set_axis_on()`.
2160 'equal' Set equal scaling (i.e., make circles circular) by
2161 changing the axis limits. This is the same as
2162 ``ax.set_aspect('equal', adjustable='datalim')``.
2163 Explicit data limits may not be respected in this case.
2164 'scaled' Set equal scaling (i.e., make circles circular) by
2165 changing dimensions of the plot box. This is the same as
2166 ``ax.set_aspect('equal', adjustable='box', anchor='C')``.
2167 Additionally, further autoscaling will be disabled.
2168 'tight' Set limits just large enough to show all data, then
2169 disable further autoscaling.
2170 'auto' Automatic scaling (fill plot box with data).
2171 'image' 'scaled' with axis limits equal to data limits.
2172 'square' Square plot; similar to 'scaled', but initially forcing
2173 ``xmax-xmin == ymax-ymin``.
2174 ================ ===========================================================
2175
2176 emit : bool, default: True
2177 Whether observers are notified of the axis limit change.
2178 This option is passed on to `~.Axes.set_xlim` and
2179 `~.Axes.set_ylim`.
2180
2181 Returns
2182 -------
2183 xmin, xmax, ymin, ymax : float
2184 The axis limits.
2185
2186 See Also

Callers 15

finishMethod · 0.45
axisFunction · 0.45
test_label_coloursFunction · 0.45
test_diff_cell_tableFunction · 0.45
test_auto_columnFunction · 0.45
test_svg_font_stringFunction · 0.45
test_integration_optionsFunction · 0.45
test_marker_clippingFunction · 0.45
test_rgba_markersFunction · 0.45
test_shared_aspect_errorFunction · 0.45
test_axis_errorsFunction · 0.45
test_pie_linewidth_0Function · 0.45

Calls 11

set_axis_onMethod · 0.95
set_axis_offMethod · 0.95
set_autoscale_onMethod · 0.95
set_aspectMethod · 0.95
autoscale_viewMethod · 0.95
get_xlimMethod · 0.95
get_ylimMethod · 0.95
set_xlimMethod · 0.95
set_ylimMethod · 0.95
joinMethod · 0.80
popMethod · 0.45

Tested by 15

test_label_coloursFunction · 0.36
test_diff_cell_tableFunction · 0.36
test_auto_columnFunction · 0.36
test_svg_font_stringFunction · 0.36
test_integration_optionsFunction · 0.36
test_marker_clippingFunction · 0.36
test_rgba_markersFunction · 0.36
test_shared_aspect_errorFunction · 0.36
test_axis_errorsFunction · 0.36
test_pie_linewidth_0Function · 0.36
test_pie_center_radiusFunction · 0.36
test_pie_linewidth_2Function · 0.36