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

DevilFi5h picture DevilFi5h · Jun 13, 2011 · Viewed 17k times · Source

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.

Answer

DSM picture DSM · Jun 13, 2011

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.