Set this Axis' scale. Parameters ---------- value : str or `.ScaleBase` The axis scale type to apply. Valid string values are the names of scale classes ("linear", "log", "function",...). These may be the names of any of the :re
(self, value, **kwargs)
| 800 | |
| 801 | # This method is directly wrapped by Axes.set_{x,y}scale. |
| 802 | def _set_axes_scale(self, value, **kwargs): |
| 803 | """ |
| 804 | Set this Axis' scale. |
| 805 | |
| 806 | Parameters |
| 807 | ---------- |
| 808 | value : str or `.ScaleBase` |
| 809 | The axis scale type to apply. Valid string values are the names of scale |
| 810 | classes ("linear", "log", "function",...). These may be the names of any |
| 811 | of the :ref:`built-in scales<builtin_scales>` or of any custom scales |
| 812 | registered using `matplotlib.scale.register_scale`. |
| 813 | |
| 814 | **kwargs |
| 815 | If *value* is a string, keywords are passed to the instantiation method of |
| 816 | the respective class. |
| 817 | """ |
| 818 | name = self._get_axis_name() |
| 819 | old_default_lims = (self.get_major_locator() |
| 820 | .nonsingular(-np.inf, np.inf)) |
| 821 | for ax in self._get_shared_axes(): |
| 822 | ax._axis_map[name]._set_scale(value, **kwargs) |
| 823 | ax._update_transScale() |
| 824 | ax.stale = True |
| 825 | new_default_lims = (self.get_major_locator() |
| 826 | .nonsingular(-np.inf, np.inf)) |
| 827 | if old_default_lims != new_default_lims: |
| 828 | # Force autoscaling now, to take advantage of the scale locator's |
| 829 | # nonsingular() before it possibly gets swapped out by the user. |
| 830 | self.axes.autoscale_view( |
| 831 | **{f"scale{k}": k == name for k in self.axes._axis_names}) |
| 832 | |
| 833 | def limit_range_for_scale(self, vmin, vmax): |
| 834 | """ |
no test coverage detected