show#
Plotting helper functions.
- hsl_to_rgb(H, S, L)#
Convert color from HSL to RGB.
- vector_to_rgb(x, y, z)#
Map vector (with norm ≤ 1) to RGB.
- get_rgba(field, quantity=None, layer=None)#
Get rgba values of given field. There is also a CUDA version of this function which utilizes the GPU. Use
mumaxplus.FieldQuantity.get_rgb()
, but it has a different shape.- Parameters:
quantity (FieldQuantity (default None)) – Used to set alpha value to 0 where geometry is False.
layer (int (default None)) – z-layer of which to get rgba. Calculates rgba for all layers if None.
- Returns:
rgba – shape (ny, nx, 4) if layer is given, otherwise (nz, ny, nx, 4).
- Return type:
ndarray
- show_field(quantity, layer=0)#
Plot a
mumaxplus.FieldQuantity()
with 3 components using the mumax³ colorscheme.
- plotter(quantity, rgba, name='')#
- show_layer(quantity, component=0, layer=0)#
Visualize a single component of a
mumaxplus.FieldQuantity()
.
- show_neel_quiver(quantity, title='')#
- show_magnet_geometry(magnet)#
Show the geometry of a
mumaxplus.Ferromagnet()
.
- show_field_3D(quantity, cmap='mumax3', quiver=True)#
Plot a
mumaxplus.FieldQuantity()
with 3 components as a vectorfield.- Parameters:
quantity (mumaxplus.FieldQuantity (3 components)) – The FieldQuantity to plot as a vectorfield.
cmap (string, optional, default: "mumax3") – A colormap to use. By default the mumax³ colormap is used. Any matplotlib colormap can also be given to color the vectors according to their z-component. It’s best to use diverging colormaps, like “bwr”.
quiver (boolean, optional, default: True) – If set to True, a cone is placed at each cell indicating the direction. If False, colored voxels are used instead.
- show_regions(magnet, layer=0)#
Plot the boundaries between regions of the given magnet.