Pretty-print *val*.
(self, val)
| 948 | event.xdata if self.orientation == "horizontal" else event.ydata) |
| 949 | |
| 950 | def _format(self, val): |
| 951 | """Pretty-print *val*.""" |
| 952 | if self.valfmt is not None: |
| 953 | if callable(self.valfmt): |
| 954 | return f"({self.valfmt(val[0])}, {self.valfmt(val[1])})" |
| 955 | else: |
| 956 | return f"({self.valfmt % val[0]}, {self.valfmt % val[1]})" |
| 957 | else: |
| 958 | _, s1, s2, _ = self._fmt.format_ticks( |
| 959 | [self.valmin, *val, self.valmax] |
| 960 | ) |
| 961 | # fmt.get_offset is actually the multiplicative factor, if any. |
| 962 | s1 += self._fmt.get_offset() |
| 963 | s2 += self._fmt.get_offset() |
| 964 | # Use f string to avoid issues with backslashes when cast to a str |
| 965 | return f"({s1}, {s2})" |
| 966 | |
| 967 | def set_min(self, min): |
| 968 | """ |
no test coverage detected