简体   繁体   中英

How to change boxplot size in seaborn FacetGrid object

I have a row of boxplots I produce using the following code:

import seaborn as sns
g = sns.FacetGrid(df, col="Column0", sharex=False)
g.map(sns.boxplot, 'column1', 'Column2')

It works well with the exception that the plots are super tiny. I have looked at How can I change the font size using seaborn FacetGrid? and How to change figuresize using seaborn factorplot as well as the seaborn manual, but I do not find the right way to include 'size' and 'aspect' into the code. What would be the proper way to change the plot size?

EDIT

If I try it like this:

g = sns.FacetGrid(df, col="Column0", sharex=False, size=20, aspect=3)
g.map(sns.boxplot, 'Column1', 'Column2')

I get the error: ValueError: width and height must each be below 32768 . Is there a restriction in size for plots that are produced the way I do it?

Maybe you can try limiting maximum x and y values so that you plot will automatically adjust to values that are important.

g.set(xlim=(0, 60), ylim=(0, 14));

you say that plot is super tiny that means there are some elements present with very high values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM