Utilities

A few miff-muffet-moof functions.


zip_axes

vtkplotlib.zip_axes(*axes)

Convert vertex data from seperate arrays for x, y, z to a single combined points array like most vpl functions require.

Parameters:axes (array_like or scalar) – Each seperate axis to combine.

All axes must have the matching or broadcastable shapes. The number of axes doesn’t have to be 3.

import vtkplotlib as vpl
import numpy as np

vpl.zip_axes(np.arange(10),
             4,
             np.arange(-5, 5))

# Out: array([[ 0,  4, -5],
#             [ 1,  4, -4],
#             [ 2,  4, -3],
#             [ 3,  4, -2],
#             [ 4,  4, -1],
#             [ 5,  4,  0],
#             [ 6,  4,  1],
#             [ 7,  4,  2],
#             [ 8,  4,  3],
#             [ 9,  4,  4]])

See also

unzip_axes() for the reverse.


unzip_axes

vtkplotlib.unzip_axes(points)

Seperate each component from an array of points.

Parameters:points (np.ndarray) – Some points.
Returns:Each axis separately as a tuple.
Return type:tuple of arrays

See vpl.zip_axes() more information and the reverse.


quick_test_plot

vtkplotlib.quick_test_plot(fig='gcf')

A quick laziness function to create 30 random spheres.

Parameters:fig (vtkplotlib.figure, vtkplotlib.QtFigure, optional) – The figure to plot into, can be None, defaults to vtkplotlib.gcf().
import vtkplotlib as vpl

vpl.quick_test_plot()
vpl.show()