# Is threre a way to interact with PythonView?

**URL:** https://discourse.paraview.org/t/is-threre-a-way-to-interact-with-pythonview/7108
**Category:** ParaView Support
**Tags:** python
**Created:** [April 30, 2021, 9:34am UTC](https://discourse.paraview.org/t/is-threre-a-way-to-interact-with-pythonview/7108 "2021-04-30T09:34:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ymjia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/ccd318/32.png) [@ymjia](https://discourse.paraview.org/u/ymjia)
#### Post date: [April 30, 2021, 9:34am UTC](https://discourse.paraview.org/t/is-threre-a-way-to-interact-with-pythonview/7108/1 "2021-04-30T09:34:04Z")

</div>

I am using matplotlib through PythonView, and try to do something respond to a mouse click, Is it possible?

I found the render() function will re-run after mouse drag in PythonView, if the render function can get some mouse information, it will also help:)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 30, 2021, 9:52am UTC](https://discourse.paraview.org/t/is-threre-a-way-to-interact-with-pythonview/7108/2 "2021-04-30T09:52:05Z")

</div>

You would need to use matplotlib interactivity features: [Interactive Figures — Matplotlib 3.4.1 documentation](https://matplotlib.org/stable/users/interactive.html)

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/csatizoltan/32/6997_2.png) [@CsatiZoltan](https://discourse.paraview.org/u/CsatiZoltan)
#### Post date: [May 27, 2026, 9:15am UTC](https://discourse.paraview.org/t/is-threre-a-way-to-interact-with-pythonview/7108/3 "2026-05-27T09:15:30Z")

</div>

It is possible to embed a Matplotlib figure into Qt using Qt for Python ([example 1](https://doc.qt.io/qtforpython-6/examples/example_external_matplotlib_widget_gaussian.html), [example 2](https://doc.qt.io/qtforpython-6/examples/example_external_matplotlib_widget3d.html)) thanks to the Qt [backend](https://matplotlib.org/stable/users/explain/figure/backends.html) of Matplotlib. Does it require PySide though? Is there a way to embed it directly in C++ Qt?  
I would like to create a custom Qt widget that contains a Matplotlib figure, and this custom widget would be docked as a panel in ParaView.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [May 27, 2026, 10:21am UTC](https://discourse.paraview.org/t/is-threre-a-way-to-interact-with-pythonview/7108/4 "2026-05-27T10:21:40Z")

</div>

You mentioned Python View - I’m not sure if you are referring to the actual view type in ParaView that you can use to display images generated in Python through libraries like matplotlib. In any case, it sounds like you want to display the content of a matplotlib window in Qt, including UI elements that respond to user input - Python View is not suitable for this.

> [@CsatiZoltan](#):
>
> Is there a way to embed it directly in C++ Qt?

It should be possible to invoke just a little bit of Python code from C++ to embed a matplotlib figure and provide interactivity. However, you won’t be able to use the Qt backend without PySide as it is a requirement. My guess is you’ll be able to use matplotlib to render without problem using a non-Qt backend, like in the Python View, but that you’ll need to handle image display in Qt and supply all the user interaction code.

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/csatizoltan/32/6997_2.png) [@CsatiZoltan](https://discourse.paraview.org/u/CsatiZoltan)
#### Post date: [May 27, 2026, 10:50am UTC](https://discourse.paraview.org/t/is-threre-a-way-to-interact-with-pythonview/7108/5 "2026-05-27T10:50:27Z")

</div>

My demand comes from the fact that the Line Chart View cannot display all I want. So I want Matplotlib. One way is the Python View view type, but it renders the graph as an image, so the interactivity is lost. That’s why I thought about embedding the whole Matplotlib figure, with its control widgets, into ParaView.

> However, you won’t be able to use the Qt backend without PySide as it is a requirement

That was my fear. Although one could install PySide into the virtual environment of ParaView.

> you’ll need to handle image display in Qt and supply all the user interaction code.

I thought of that. But it is not trivial to write the interaction code myself for the widgets that Matplotlib already has. Also note that converting the plot to a `vtkImageData` to display it in a Python View comes with the loss of information. Even if I implement the zooming widgets, it will magnify the pixels in the image, so it will become blurry.
