<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Title
Step1:  Read in the data
We will use pandas pd.read_csv() function to read in the data file. We'll bring in the .csv file and save it in a pandas dataframe called df.
Step2:  Make the violin plot
We will make the violin plot using seaborns sns.violinplot() function. Two arguments are added to the function call data=df which specifies the data included in the plot and palette="pastel" which specifies a nice looking color pallet.
Step3:  Save the figure
To save the violin plot, we will use matplotlibs ax.get_figure() method. This creates a figure object that we'll call fig. We then use matplotlibs fig.savefig() method to save the figure.
Step4:  The whole script
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
Explanation: Title: Violin plot with python, matplotlib and seaborn
Date: 2017-10-19 10:42
Modified: 2017-10-19 10:42
Slug: violin-plot-with-python-matplotlib-seaborn
Import the necessary packages
End of explanation
df = pd.read_csv('LAB_3_large_data_set_cleaned.csv')
Explanation: Read in the data
We will use pandas pd.read_csv() function to read in the data file. We'll bring in the .csv file and save it in a pandas dataframe called df.
End of explanation
ax = sns.violinplot(data=df, palette="pastel")
plt.show()
Explanation: Make the violin plot
We will make the violin plot using seaborns sns.violinplot() function. Two arguments are added to the function call data=df which specifies the data included in the plot and palette="pastel" which specifies a nice looking color pallet.
End of explanation
fig = ax.get_figure()
fig.savefig('sns_violin_plot.png', dpi=300)
Explanation: Save the figure
To save the violin plot, we will use matplotlibs ax.get_figure() method. This creates a figure object that we'll call fig. We then use matplotlibs fig.savefig() method to save the figure.
End of explanation
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
df = pd.read_csv('LAB_3_large_data_set_cleaned.csv')
ax = sns.violinplot(data=df, palette="pastel")
plt.show()
fig = ax.get_figure()
fig.savefig('sns_violin_plot.png', dpi=300)
Explanation: The whole script
End of explanation
<END_TASK>