Args: See `plot()`.
(*fields: Union[Field, Tensor, Geometry, list, tuple, dict],
lib: Union[str, PlottingLibrary] = None,
row_dims: DimFilter = None,
col_dims: DimFilter = batch,
animate: DimFilter = None,
overlay: DimFilter = 'overlay',
title: Union[str, Tensor, list, tuple] = None,
size=None, # (12, 5),
same_scale: Union[bool, Shape, tuple, list, str] = True,
log_dims: Union[str, tuple, list, Shape] = '',
show_color_bar=True,
color: Union[str, int, Tensor, list, tuple] = None,
alpha: Union[float, Tensor, list, tuple] = 1.,
err: Union[Tensor, tuple, list, float] = 0.,
frame_time=100,
repeat=True,
plt_params: Dict = None,
max_subfigures=20)
| 22 | |
| 23 | |
| 24 | def show(*fields: Union[Field, Tensor, Geometry, list, tuple, dict], |
| 25 | lib: Union[str, PlottingLibrary] = None, |
| 26 | row_dims: DimFilter = None, |
| 27 | col_dims: DimFilter = batch, |
| 28 | animate: DimFilter = None, |
| 29 | overlay: DimFilter = 'overlay', |
| 30 | title: Union[str, Tensor, list, tuple] = None, |
| 31 | size=None, # (12, 5), |
| 32 | same_scale: Union[bool, Shape, tuple, list, str] = True, |
| 33 | log_dims: Union[str, tuple, list, Shape] = '', |
| 34 | show_color_bar=True, |
| 35 | color: Union[str, int, Tensor, list, tuple] = None, |
| 36 | alpha: Union[float, Tensor, list, tuple] = 1., |
| 37 | err: Union[Tensor, tuple, list, float] = 0., |
| 38 | frame_time=100, |
| 39 | repeat=True, |
| 40 | plt_params: Dict = None, |
| 41 | max_subfigures=20): |
| 42 | """ |
| 43 | Args: |
| 44 | See `plot()`. |
| 45 | """ |
| 46 | if not fields: # only show, no plot |
| 47 | if lib is not None: |
| 48 | plots = get_plots(lib) |
| 49 | else: |
| 50 | if not LAST_FIGURE: |
| 51 | warnings.warn("No plot yet created with phi.vis; nothing to show.", RuntimeWarning) |
| 52 | return |
| 53 | plots = get_plots_by_figure(LAST_FIGURE[0]) |
| 54 | return plots.show(plots.current_figure) |
| 55 | else: |
| 56 | kwargs = locals() |
| 57 | del kwargs['fields'] |
| 58 | fig = plot(*fields, **kwargs) |
| 59 | plots = get_plots_by_figure(fig) |
| 60 | if isinstance(fig, Tensor): |
| 61 | for fig in fig: |
| 62 | plots.show(fig) |
| 63 | else: |
| 64 | return plots.show(fig) |
| 65 | |
| 66 | |
| 67 | def show_hist(data: Tensor, bins=math.instance(bins=20), weights=1, same_bins: DimFilter = None): |