| 473 | return data.spatial_rank == 3 and 'vector' in channel(data) |
| 474 | |
| 475 | 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): |
| 476 | dims = space.vector.item_names |
| 477 | vector = data.geometry.shape['vector'] |
| 478 | x, y, z = reshaped_numpy(data.center[dims], [vector, data.shape.without('vector')]) |
| 479 | u, v, w = reshaped_numpy(data.values[dims], [vector, data.shape.without('vector')]) |
| 480 | if color.shape: |
| 481 | col = [_plt_col(c) for c in color.numpy(data.shape.non_channel).reshape(-1)] |
| 482 | else: |
| 483 | col = _plt_col(color) |
| 484 | alphas = reshaped_numpy(alpha, [data.shape.without('vector')]) |
| 485 | subplot.quiver(x, y, z, u, v, w, color=col, alpha=alphas) |
| 486 | |
| 487 | |
| 488 | class StreamPlot2D(Recipe): |