Return the figure width and height in integral points or pixels. When the figure is used on High DPI screens (and the backend supports it), the truncation to integers occurs after scaling by the device pixel ratio. Parameters ---------- phys
(self, *, physical=False)
| 2040 | return True |
| 2041 | |
| 2042 | def get_width_height(self, *, physical=False): |
| 2043 | """ |
| 2044 | Return the figure width and height in integral points or pixels. |
| 2045 | |
| 2046 | When the figure is used on High DPI screens (and the backend supports |
| 2047 | it), the truncation to integers occurs after scaling by the device |
| 2048 | pixel ratio. |
| 2049 | |
| 2050 | Parameters |
| 2051 | ---------- |
| 2052 | physical : bool, default: False |
| 2053 | Whether to return true physical pixels or logical pixels. Physical |
| 2054 | pixels may be used by backends that support HiDPI, but still |
| 2055 | configure the canvas using its actual size. |
| 2056 | |
| 2057 | Returns |
| 2058 | ------- |
| 2059 | width, height : int |
| 2060 | The size of the figure, in points or pixels, depending on the |
| 2061 | backend. |
| 2062 | """ |
| 2063 | return tuple(int(size / (1 if physical else self.device_pixel_ratio)) |
| 2064 | for size in self.figure.bbox.max) |
| 2065 | |
| 2066 | @classmethod |
| 2067 | def get_supported_filetypes(cls): |
no outgoing calls