How do you change the spread of the Y axis of pandas box plot?

Viewed 155

I am plotting 100 data points for 9 different groups. One group's data points are much larger than all the other groups so when I make a box graph using pandas only that group is shown, while all other groups are smashed to the bottom. Here is what it looks like now: smushed box plot

I would like the Y axis to be more spaced out so that I can see the other groups' box graphs. Here is similar data in a scatter plot that has the spacing I am looking for: well spaced scatter plot

now need this
What I have What is need

Here is my code at the moment:

# use ``` to designate a code block in markdown
import pandas as pd 
import matplotlib.pyplot as plt 

df = pd.read_csv("residues.csv")
df.plot.box()
plt.show()
2 Answers

It looks like you want y to be log-scaled:

df.plot.box(logy=True)

with/without logy

Related