Return a scale factor for converting from units to pixels.
(self, units)
| 621 | self.stale = True |
| 622 | |
| 623 | def _dots_per_unit(self, units): |
| 624 | """Return a scale factor for converting from units to pixels.""" |
| 625 | bb = self.axes.bbox |
| 626 | vl = self.axes.viewLim |
| 627 | return _api.getitem_checked({ |
| 628 | 'x': bb.width / vl.width, |
| 629 | 'y': bb.height / vl.height, |
| 630 | 'xy': np.hypot(*bb.size) / np.hypot(*vl.size), |
| 631 | 'width': bb.width, |
| 632 | 'height': bb.height, |
| 633 | 'dots': 1., |
| 634 | 'inches': self.axes.get_figure(root=True).dpi, |
| 635 | }, units=units) |
| 636 | |
| 637 | def _set_transform(self): |
| 638 | """ |
no test coverage detected