[Paraview] Python View Visualization

Nick French nqfrench9 at gmail.com
Tue Aug 1 10:42:32 EDT 2017


Hi,

I've created a ParaView plugin (.xml file) that takes an input .txt file
and creates an image (similar to this example:
https://www.paraview.org/Wiki/Python_Programmable_Filter#Gen
erating_Data_.28Programmable_Source.29).  Now I want add some script to my
python code that will allow for matplotlib plots to be made in a separate
window.  It seems like this is possible from Figure 4.15 of the most recent
guide.  Is there any easy way to do this?

I made up the following script to add to the end of my code to just
generate a simple histogram, but so far nothing shows up.  I've also tested
it in the Programmable Source python script box with no luck.

from paraview import python_view
figure = python_view.matplotlib_figure (100 , 100)
ax = figure.add_subplot(1,1,1)
ax.hist([4, 21, 4, 5, 2, 5, 6, 23, 21, 12, 11, 5], bins =10)
python_view.figure_to_image(figure)

I've also tried to create a 'PythonView', but all that does is create a
black screen.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170801/c2bce3a2/attachment.html>


More information about the ParaView mailing list