How do you create a 'pin plot' in matplotlib, or is another library required? The code I have to plot points is below. The top plot is the output of my code, the second is the ideal output.
def getData(n): data = [] for i in range(n): data.append(i) return data fig, axs = plt.subplots(2, 2) n = 10 axs[0, 0].scatter([i for i in range(n)], getData(n)) plt.show()
This is called a stem plot in matplotlib:
stem
plt.stem(range(10), markerfmt='None', basefmt='C0-')
1.4m articles
1.4m replys
5 comments
57.0k users