Is threre a way to interact with PythonView?

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:)

You would need to use matplotlib interactivity features: Interactive Figures — Matplotlib 3.4.1 documentation

It is possible to embed a Matplotlib figure into Qt using Qt for Python (example 1, example 2) thanks to the Qt backend 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.

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.

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.

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.