5. Visualization#

This chapter will be more eloborate in the future.

At the moment, samples and experimental setups can be inspected with

>>> sample.show()
>>> exp.show()

which will display a 3D view using the k3d package.

tetrax.core.sample.AbstractSample.show(self, show_node_labels=False, show_mag=True, comp='vec', scale=5)#

Show the sample. Displays the mesh and, if available, the magnetization(s).

Parameters
show_node_labelsbool

If true, shows the label associated to each node.

show_magbool

Show the magnetization (or magnetizations, in the case of antiferromagnetic samples).

comp{“vec”, “x”, “y”, “z”}

Determines which component will be plotted.

scalefloat

Determines the scale of the vector glyphs used to visualize the magnetization (default is 5).

Returns
tetrax.core.experimental_setup.ExperimentalSetup.show(self, comp='vec', scale=5, show_antenna=True)#

Shows the experimental setup, including external fields and microwave antennna.

Parameters
comp{“vec”, “x”, “y”, “z”}

If external field is nonzero, determines which component will be plotted.

scalefloat

Determines the scale of the vector glyphs used to visualize the magnetization (default is 5).

show_antennabool

If available, show the microwave antenna (default is True).

It is also possible to plot scalar fields or veftor fields defined on a given sample using the plot() method of a sample.

>>> vector_field = tx.vectorfields.helical(sample.xyz, 90, 1)
>>> sample.plot(vector_field)
tetrax.core.sample.AbstractSample.plot(self, fields, comp='vec', scale=5, labels=None)#

Plot a vector or scalar field which is defined on each node of the mesh. Multiple fields can be plotted at the same time.

Parameters
fieldsnumpy.array or list(numpy.array)

Scalar field of shape (nx,), vector field of shape (nx,3) or list containing any choice of the aforementioned.

comp{“vec”, “x”, “y”, “z”}

If field is a vector field, this parameter determines which component will be plotted.

scalefloat

Determines the scale of the vector glyphs used to visualize a vectorfield (default is 5).

labelsstr or list(str)

Label(s) of the vectorfield(s) to be plotted. If labels is a list, it needs to have the same length as fields (default is None).