0

I want to create a violinplot using seaborn and I am a little confused on how to use the parameters. I have my data stored in 6 lists (all having the same length): file1_score & file1_rms * - the 2 lists for file 1*

file2_score & file2_rms * - the 2 lists for file 2*

file3_score & file3_rms * - the 2 lists for file 3*

I want to observe the distributions of scores at distinct rms for the three different files. My output should look like this:

Photo of the expected graph

Can someone please help me with the code? Thank you in advance.

Mr. T
  • 11,960
  • 10
  • 32
  • 54
AdeEla
  • 279
  • 1
  • 3
  • 13
  • Does "please help me with the code" translate to "please write that code for me"? See [ask] and [mcve]. Note that seaborn may not be the best choice if you have several lists instead of a pandas DataFrame; consider using matplotlib's violinplots instead. – ImportanceOfBeingErnest Jul 23 '18 at 13:58
  • No, I just needed a starting point on how to use the lists but I'll try printing them in files and then reading the files to use seaborn – AdeEla Jul 23 '18 at 14:02
  • 1
    So if you have 3 lists `a`, `b`, `c`, what's wrong with `plt.violinplot([a,b,c])`? – ImportanceOfBeingErnest Jul 23 '18 at 14:09

1 Answers1

0

It's a little too complicated probably but I printed my lists in cvs files and then ran the following code:

import pandas as pd
df=pd.read_csv("Thatfile.csv")
import seaborn as sns
sns.set('paper', color_codes=True)
sns.violinplot(x= 'rms', y= 'file_type', data = df)

And I got the output that I wanted

Mr. T
  • 11,960
  • 10
  • 32
  • 54
AdeEla
  • 279
  • 1
  • 3
  • 13