python_view Module

python_view is a module providing access to a PythonView. It is possible to use the PythonView API directly, but this module provides convenience classes in Python.

paraview.python_view.call_render(render_function, view, width, height)[source]
@brief Utility function to call the user-defined render function. This is
called by the C++ side of the vtkPythonView class.

@parameter view vtkPythonView object @parameter width Width of view @parameter height Height of view

paraview.python_view.call_setup_data(setup_data_function, view)[source]
@brief Utility function to call the user-defined setup_data function. This is
meant to be called by the C++ side of the vtkPythonView class.

@parameter view vtkPythonView object

paraview.python_view.figure_to_data(figure)[source]

@brief Convert a Matplotlib figure to a numpy 2D array with RGBA uint8 channels and return it. @param figure A matplotlib figure. @return A numpy 2D array of RGBA values.

paraview.python_view.figure_to_image(figure)[source]

@brief Convert a Matplotlib figure to a vtkImageData with RGBA unsigned char channels @param figure A matplotlib figure. @return a vtkImageData with the Matplotlib figure content

paraview.python_view.matplotlib_figure(width, height)[source]

@brief Create a Matplotlib figure with specified width and height for rendering @param w Width of desired plot @param h Height of desired plot @return A Matplotlib figure

paraview.python_view.numpy_to_image(numpy_array)[source]

@brief Convert a numpy 2D or 3D array to a vtkImageData object @param numpy_array 2D or 3D numpy array containing image data @return vtkImageData with the numpy_array content