(lib: Union[str, PlottingLibrary])
| 558 | |
| 559 | |
| 560 | def get_plots(lib: Union[str, PlottingLibrary]) -> PlottingLibrary: |
| 561 | if isinstance(lib, PlottingLibrary): |
| 562 | return lib |
| 563 | for loaded_lib in _LOADED_PLOTTING_LIBRARIES: |
| 564 | if loaded_lib.name == lib: |
| 565 | return loaded_lib |
| 566 | if lib == 'matplotlib': |
| 567 | from ._matplotlib._matplotlib_plots import MATPLOTLIB |
| 568 | _LOADED_PLOTTING_LIBRARIES.append(MATPLOTLIB) |
| 569 | return MATPLOTLIB |
| 570 | elif lib == 'plotly': |
| 571 | from ._dash._plotly_plots import PLOTLY |
| 572 | _LOADED_PLOTTING_LIBRARIES.append(PLOTLY) |
| 573 | return PLOTLY |
| 574 | elif lib == 'ascii': |
| 575 | from ._console._console_plot import CONSOLE |
| 576 | _LOADED_PLOTTING_LIBRARIES.append(CONSOLE) |
| 577 | return CONSOLE |
| 578 | else: |
| 579 | raise NotImplementedError(f"No plotting library available with name {lib}") |
| 580 | |
| 581 | |
| 582 | def get_plots_by_figure(figure: Union[Tensor, Any]): |
no test coverage detected