I'm using Python 2.7.6 32-bit with Matplotlib 1.3.1.
When I use the default backend, like in this example, the figure is shown:
import matplotlib.pyplot as plt
plt.plot(range(10))
plt.show()
When I try to use WebAgg, the MPL page loads automatically, but without any figures:
import matplotlib
matplotlib.use('webagg')
import matplotlib.pyplot as plt
plt.plot(range(10))
plt.show()
I tested this code on Windows and Ubuntu, using Firefox, Chrome and IE, without any success...
Can somebody help, please? Thanks in advance!
Because, when plt. show is executed, it displays figure on the screen and closes the figure. This is why you get an empty plot when you save it after plt.
The last, Agg, is a non-interactive backend that can only write to files. It is used on Linux, if Matplotlib cannot connect to either an X display or a Wayland display.
After a lot of searching and testing, I ended up using pip to uninstall Matplotlib, then reinstall it (using the --upgrade command, just to be sure):
pip uninstall matplotlib
pip install matplotlib --upgrade
And it worked! Now I can see the WebAgg plots on the browser window!
Maybe I wasn't installing Matplotlib properly...
Thanks for the suggestions!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With