Set the font size. Parameters ---------- size : float or {'xx-small', 'x-small', 'small', 'medium', \ 'large', 'x-large', 'xx-large'}, default: :rc:`font.size` If a float, the font size in points. The string values denote sizes relative to th
(self, size)
| 1022 | raise ValueError(f"{stretch=} is invalid") |
| 1023 | |
| 1024 | def set_size(self, size): |
| 1025 | """ |
| 1026 | Set the font size. |
| 1027 | |
| 1028 | Parameters |
| 1029 | ---------- |
| 1030 | size : float or {'xx-small', 'x-small', 'small', 'medium', \ |
| 1031 | 'large', 'x-large', 'xx-large'}, default: :rc:`font.size` |
| 1032 | If a float, the font size in points. The string values denote |
| 1033 | sizes relative to the default font size. |
| 1034 | """ |
| 1035 | size = mpl._val_or_rc(size, 'font.size') |
| 1036 | try: |
| 1037 | size = float(size) |
| 1038 | except ValueError: |
| 1039 | try: |
| 1040 | scale = font_scalings[size] |
| 1041 | except KeyError as err: |
| 1042 | raise ValueError( |
| 1043 | "Size is invalid. Valid font size are " |
| 1044 | + ", ".join(map(str, font_scalings))) from err |
| 1045 | else: |
| 1046 | size = scale * FontManager.get_default_size() |
| 1047 | if size < 1.0: |
| 1048 | _log.info('Fontsize %1.2f < 1.0 pt not allowed by FreeType. ' |
| 1049 | 'Setting fontsize = 1 pt', size) |
| 1050 | size = 1.0 |
| 1051 | self._size = size |
| 1052 | |
| 1053 | def set_file(self, file): |
| 1054 | """ |
no test coverage detected