2

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?

2 Answers 2

5

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: enter image description here

Sign up to request clarification or add additional context in comments.

Comments

1

IPython with %matplotlib inline as demonstrated here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.