MCPcopy
hub / github.com/tum-pbs/PhiFlow / get_plots

Function get_plots

phi/vis/_vis.py:560–579  ·  view source on GitHub ↗
(lib: Union[str, PlottingLibrary])

Source from the content-addressed store, hash-verified

558
559
560def 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
582def get_plots_by_figure(figure: Union[Tensor, Any]):

Callers 3

showFunction · 0.85
plotFunction · 0.85
default_plotsFunction · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected