I am working on matplotlib and created some graphs like bar chart, bubble chart and others.
Can some one please explain with an example what is difference between line graph and sparkline graph and how to draw spark line graphs in python using matplotlib ?
for example with the following code
import matplotlib.pyplot as plt
import numpy as np
A sparkline graph is just a regular plot with all the axis removed. quite simple to do with
import matplotlib.pyplot as plt import numpy as np # create some random data x = np.cumsum(np.random.rand(1000)-0.5) # plot it fig, ax = plt.subplots(1,1,figsize=(10,3)) plt.plot(x, color='k') plt.plot(len(x)-1, x[-1], color='r', marker='o') # remove all the axes for k,v in ax.spines.items(): v.set_visible(False) ax.set_xticks() ax.set_yticks() #show it plt.show()