I'm calling seaborn.boxplot roughly as follows:
seaborn.boxplot(ax=ax1,
x="centrality", y="score", hue="model", data=data],
palette=seaborn.color_palette("husl", len(models) +1),
showfliers=False,
hue_order=order,
linewidth=1.5)
Is it possible to make one box stand out by giving it a specific color, while coloring all others with the given color palette?
The boxes made using
sns.boxplot
are really justmatplotlib.patches.PathPatch
objects. These are stored inax.artists
as a list.So, we can select one box in particular by indexing
ax.artists
. Then, you can set thefacecolor
,edgecolor
andlinewidth
, among many other properties.For example (based on one of the examples here):