Python – Pycharm Jupyter interactive Matplotlib

Pycharm Jupyter interactive Matplotlib… here is a solution to the problem.

Pycharm Jupyter interactive Matplotlib

Interactive matplotlib plotting is already a reality, but when used in jupyter notebooks, it does not work properly in Pycharm.

%matplotlib notebook not working (no error thrown, but what I got was instead of plotting. If I draw normally (with or without plt.show()), I will only get a png and cannot interact in any way (even, for example, the slider is visible).

I can’t find any answer to this exact question elsewhere. It may work in the browser version of jupyter, but I want to stick with PyCharm.

Pycharm v 2017.3 Community Edition

Solution

You can try:

import matplotlib 
matplotlib.use('Qt5Agg') 
import matplotlib.pyplot as plt

Instead of just importing peplos.
This is a trick I found on the Jetbrains forum
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000736584-SciView-in-PyCharm-2017-3-reduces-functionality-of-Matplotlib This one worked for me. With this, you actually skip Sciview and plot in a normal matplotlib window

Related Problems and Solutions