Check out example codes for "how to draw matplotlib on a html page". It will help you in understanding the concepts better.

Code Example 1

import matplotlib.pyplot as plt, mpld3
plt.plot([3,1,4,1,5], 'ks-', mec='w', mew=5, ms=20)
mpld3.show()

Learn ReactJs, React Native from akashmittal.com