Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 203
DevilFi5h Avatar asked Jun 13 '11 08:06

DevilFi5h


People also ask

What is the method used in matplotlib to generate scatter plots?

Scatter plots are used to observe relationship between variables and uses dots to represent the relationship between them. The scatter() method in the matplotlib library is used to draw a scatter plot.

What can I use instead of %Matplotlib inline?

show() . If you do not want to use inline plotting, just use %matplotlib instead of %matplotlib inline .


1 Answers

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.

like image 128
DSM Avatar answered Oct 20 '22 06:10

DSM