scatterplot instead of a lineplot while using the plotfile function of matplotlib
-
27-10-2019 - |
Question
I know the general usage of plotfile:
import matplotlib.pyplot as plt
plt.plotfile(csvfile,sometuple)
But this produces a line plot by default. I want a scatterplot. Is there some special argument that i need to pass to this method? I have already looked into the documentation and didnt find anything.
Solution
I don't see the advantages of plotfile, myself: as soon as you want to do anything interesting it's probably easier to work with the usual directives. But
matplotlib.pyplot.plotfile('dat.csv',(0,1),linestyle="",marker="o")
should replace the line by points.
OTHER TIPS
I don't know how to use the plotfile command, but in the 'just' plot I've used markers like
matplotlib.pyplot.plot(X1, Y1, 'go', X2, Y2, 'b-')
where 'go' means green circles for the first plots, 'b-' means blue lines for the second plot, 'r--' means red dashed lines, and so on...
Check out the matplotlib.pyplot.plot
documentation.