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

Method plot

phi/vis/_matplotlib/_matplotlib_plots.py:595–609  ·  view source on GitHub ↗
(self, data: Field, figure, subplot, space: Box, min_val: float, max_val: float, show_color_bar: bool, color: Tensor, alpha: Tensor, err: Tensor)

Source from the content-addressed store, hash-verified

593 return data.spatial_rank == 2
594
595 def plot(self, data: Field, figure, subplot, space: Box, min_val: float, max_val: float, show_color_bar: bool, color: Tensor, alpha: Tensor, err: Tensor):
596 dims = space.vector.item_names
597 vector = data.geometry.shape['vector']
598 channels = channel(data.points).without('vector')
599 legend_patches = []
600 # if (color == None).all:
601 # color = math.range_tensor(channels)
602 for idx, idx_n in zip(channels.meshgrid(), channels.meshgrid(names=True)):
603 col = color[idx]
604 PointCloud2D._plot_points(subplot, data[idx], dims, vector, col, alpha[idx], err[idx], min_val, max_val, index_label(idx_n))
605 if col.rank < color.rank or ((color == None).all and channels.volume > 1): # There are multiple colors
606 legend_patches = True
607 if legend_patches:
608 if not has_legend_like([index_label(idx_n) for idx_n in channels.meshgrid(names=True)], figure):
609 subplot.legend()
610
611 @staticmethod
612 def _plot_points(axis: Axes, data: Field, dims: tuple, vector: Shape, color: Tensor, alpha: Tensor, err: Tensor, min_val, max_val, label):

Callers

nothing calls this directly

Calls 4

index_labelFunction · 0.90
has_legend_likeFunction · 0.85
withoutMethod · 0.80
_plot_pointsMethod · 0.80

Tested by

no test coverage detected