(self, value)
| 722 | self._powerlimits = lims |
| 723 | |
| 724 | def format_data_short(self, value): |
| 725 | # docstring inherited |
| 726 | if value is np.ma.masked: |
| 727 | return "" |
| 728 | if isinstance(value, Integral): |
| 729 | fmt = "%d" |
| 730 | else: |
| 731 | if getattr(self.axis, "__name__", "") in ["xaxis", "yaxis"]: |
| 732 | if self.axis.__name__ == "xaxis": |
| 733 | axis_trf = self.axis.axes.get_xaxis_transform() |
| 734 | axis_inv_trf = axis_trf.inverted() |
| 735 | screen_xy = axis_trf.transform((value, 0)) |
| 736 | neighbor_values = axis_inv_trf.transform( |
| 737 | screen_xy + [[-1, 0], [+1, 0]])[:, 0] |
| 738 | else: # yaxis: |
| 739 | axis_trf = self.axis.axes.get_yaxis_transform() |
| 740 | axis_inv_trf = axis_trf.inverted() |
| 741 | screen_xy = axis_trf.transform((0, value)) |
| 742 | neighbor_values = axis_inv_trf.transform( |
| 743 | screen_xy + [[0, -1], [0, +1]])[:, 1] |
| 744 | delta = abs(neighbor_values - value).max() |
| 745 | else: |
| 746 | # Rough approximation: no more than 1e4 divisions. |
| 747 | a, b = self.axis.get_view_interval() |
| 748 | delta = (b - a) / 1e4 |
| 749 | fmt = f"%-#.{cbook._g_sig_digits(value, delta)}g" |
| 750 | return self._format_maybe_minus_and_locale(fmt, value) |
| 751 | |
| 752 | def format_data(self, value): |
| 753 | # docstring inherited |
nothing calls this directly
no test coverage detected