Set the font stretch or width. Parameters ---------- stretch : int or {'ultra-condensed', 'extra-condensed', 'condensed', \ 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', \ 'ultra-expanded'}, default: :rc:`font.stretch` If int
(self, stretch)
| 997 | raise ValueError(f"{weight=} is invalid") |
| 998 | |
| 999 | def set_stretch(self, stretch): |
| 1000 | """ |
| 1001 | Set the font stretch or width. |
| 1002 | |
| 1003 | Parameters |
| 1004 | ---------- |
| 1005 | stretch : int or {'ultra-condensed', 'extra-condensed', 'condensed', \ |
| 1006 | 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', \ |
| 1007 | 'ultra-expanded'}, default: :rc:`font.stretch` |
| 1008 | If int, must be in the range 0-1000. |
| 1009 | """ |
| 1010 | stretch = mpl._val_or_rc(stretch, 'font.stretch') |
| 1011 | if stretch in stretch_dict: |
| 1012 | self._stretch = stretch |
| 1013 | return |
| 1014 | try: |
| 1015 | stretch = int(stretch) |
| 1016 | except ValueError: |
| 1017 | pass |
| 1018 | else: |
| 1019 | if 0 <= stretch <= 1000: |
| 1020 | self._stretch = stretch |
| 1021 | return |
| 1022 | raise ValueError(f"{stretch=} is invalid") |
| 1023 | |
| 1024 | def set_size(self, size): |
| 1025 | """ |
no outgoing calls
no test coverage detected