Matplotlib.pyplot.plotfile() in Python
With the help of
pyplot.plotfile() method, we can plot the graph directly from the given csv file, we don’t have to make a separate dataframe for a particular attribute by using
pyplot.plotfile(datafile, (attr1, attr2, .....attrn))
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Return : Return the plot of attributes on a graph.
In this example we can see that by using
pyplot.plotfile() method, we are able to plot the csv file data on a graph by given attributes by using
Data File for Example #1 :
Example #2 :
Data File for Example #2 :