Search code examples
pythonmatplotlibscatter-plot

scatterplot instead of a lineplot while using the plotfile function of matplotlib


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.