Return whether the figure with the given id exists. Parameters ---------- num : int or str A figure identifier. Returns ------- bool Whether or not a figure with id *num* exists.
(num: int | str)
| 1163 | |
| 1164 | |
| 1165 | def fignum_exists(num: int | str) -> bool: |
| 1166 | """ |
| 1167 | Return whether the figure with the given id exists. |
| 1168 | |
| 1169 | Parameters |
| 1170 | ---------- |
| 1171 | num : int or str |
| 1172 | A figure identifier. |
| 1173 | |
| 1174 | Returns |
| 1175 | ------- |
| 1176 | bool |
| 1177 | Whether or not a figure with id *num* exists. |
| 1178 | """ |
| 1179 | return ( |
| 1180 | _pylab_helpers.Gcf.has_fignum(num) |
| 1181 | if isinstance(num, int) |
| 1182 | else num in get_figlabels() |
| 1183 | ) |
| 1184 | |
| 1185 | |
| 1186 | def _raise_if_figure_exists(num, func_name, clear=False): |
no test coverage detected
searching dependent graphs…