2

I want to customize the facecolor and hatched pattern of the boxes in a grouped boxplot.

I have examined the document of seaborn and found that seaborn only returns a matplotlib.axes._subplots.AxesSubplot object but not a dict object which I can use to set the properties of the boxes in the boxplot.

The closest solution that I have found is to use Pandas.Dataframe's boxplot method where it takes an input argument called return_type. If return_type=true, the return value of the boxplot method is a dict object that can be leveraged to fulfill my goal. But it has some problems on the axis label when I choose to group by over more than one column variables. The space between the boxes is not wide enough to show all the words corresponding to each combination of the column variables. I am searching for a way to fix.

hitzg
  • 12,133
  • 52
  • 54
swm
  • 21
  • 2
  • Duplicate of http://stackoverflow.com/questions/31206474/boxplot-colors-by-x-value-and-hues-differentiated-by-pattern/31214355#31214355 I think – mwaskom Jul 14 '15 at 23:17
  • @mwaskom I have a follow-up question. Is there also a way to add a hatched pattern to the legend? Thanks. – swm Jul 15 '15 at 03:50

0 Answers0