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)
| 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 |