0

I'm trying to plot a box plot using pandas. The code for the same using seaborn is as follows:

sns.boxplot(y='Salary', data=eda)

boxplot using seaborn

and this is the code I use while using pandas:

boxplot = eda.boxplot(column=['Salary'])

boxplot using pandas

is there any way I could get the same box plot using pandas as I did while using seaborn?

Edit: I need the column 'salary' on the y-axis while using pandas Thanks!

jordan
  • 1
  • 1
  • You need `eda.boxplot(..., patch_artist=True)` – JohanC Sep 17 '20 at 15:51
  • Does this answer your question? [Change the facecolor of boxplot in pandas](https://stackoverflow.com/questions/39297093/change-the-facecolor-of-boxplot-in-pandas) – JohanC Sep 17 '20 at 15:51
  • The default plot engine for pandas is matplotlib. seaborn is a high-level api for matplotlib. When you plot with either, you're using matplotlib. – Trenton McKinney Sep 17 '20 at 16:03
  • 1
    Sure, with some adjustment you could get it very close. What have you tried so far, and what went wrong with your attempts? Have you checked the available configurations in the [matplotlib documentation and examples](https://matplotlib.org/gallery/statistics/boxplot.html#sphx-glr-gallery-statistics-boxplot-py)? – G. Anderson Sep 17 '20 at 16:25

0 Answers0