Reputation: 3
I have 13 different saved CSV files in a folder and each file contains just one column of data (i previously saved these separately from a larger dataset using python having calculated what I needed to), I would like to plot each of these files as 13 different boxplots on the same plot.
I am quite new to python and I'm familiar with matplotlib, so far I know how to plot each of these files individually but of course, I would like them to be plotted next to each other so I can better compare and visualise my data.
here are two of my plots:
usingplt.boxplot(af,meanline=True,showmeans=True)
this is how I named/saved my files (just 2 of them here)
af=numpy.loadtxt(fname='af_river.csv.')
am=numpy.loadtxt(fname='am_river.csv.')
but I don't know where to go from here, do I/is there a way to create a loop which goes through each of these files separately and plots them next to each other?
Upvotes: 0
Views: 1480
Reputation: 2110
Try this
plt.boxplot([af,am],meanline=True,showmeans=True)
This will plot all the files in the same plot
Upvotes: 2