Reputation: 191
I need to open a bar charts in Matplotlib in a browser-Like Firefox- but I shouldn't use Bokeh in my Project. Any suggestions?
Upvotes: 2
Views: 7594
Reputation: 3239
Use the WebAgg backend, which opens a browser window with the plot and is fully interactive like the Qt or GTK window.
import matplotlib as mpl
mpl.use('WebAgg')
import matplotlib.pyplot as plt
# do your plotting
plt.show()
For example:
>>> import numpy as np
>>> a=np.random.random(100)
>>> b=np.random.random(100)
>>> plt.plot(a,b)
Opens http://127.0.0.1:8988/
showing:
Upvotes: 5