I'm trying to make a grouped boxplot using Seaborn (Reference), and the boxes are all incredibly narrow -- too narrow to see the grouping colors.
g = seaborn.factorplot("project_code",y="num_mutations",hue="organ",
data=grouped_donor, kind="box", aspect=3)
If I zoom in, or stretch the graphic several times the width of my screen, I can see the boxes, but obviously this isn't useful as a standard graphic.
This appears to be a function of my amount of data; if I plot only the first 500 points (of 6000), I get visible-but-small boxes. It might specifically be a function of the high variance of my data; according to the matplotlib boxplot documentation,
The default [width] is 0.5, or 0.15x(distance between extreme positions) if that is smaller.
Regardless of the reason, there's plenty of room on the graph itself for wider boxes, if I could just widen them.
Unfortunately, the boxplot keyword widths
which controls the box width isn't a valid factorplot
keyword, and I can't find a matplotlib function that'll change the width of a bar or box outside of the plotting function itself. I can't even find anyone discussing this; the closest I found was boxplot line width. Any suggestions?
hue="organ"
. – Followingpalette
keyword argument it will color thex
variable. – Followingpalette = df["organ"].map(pal_dict)
where pal_dict has organs as keys and colors as values should do the trick. – Following