import numpy as np
import matplotlib
import mplh5canvas
matplotlib.use('module://mplh5canvas.backend_h5canvas')
import matplotlib.cbook as cbook
import matplotlib.image as image
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(np.random.rand(20), '-o', ms=20, lw=2, alpha=0.7, mfc='orange')
ax.grid()
plt.show(open_plot=True)
How to embed python tkinter window into a browser?