Home > Software design >  How can I rotate axis labels in a faceted seaborn.objects plot?
How can I rotate axis labels in a faceted seaborn.objects plot?

Time:01-08

I am working with the excellent seaborn.objects module in the most recent version of seaborn.

I would like to produce a plot:

  • With rotated x-axis labels
  • With facets

Rotating x-axis labels is not directly supported within seaborn.objects (and standard stuff like plt.xticks() after making the graph doesn't work), but the documentation suggests doing it using the .on() method. .on() takes a matplotlib figure/subfigure or axis object and builds on top of it. As I pointed out in my answer to Faceted graph with strange dual labeling

How can I incorporate rotated axis labels with facets?

CodePudding user response:

You're ending up with multiple axes plotted on top of each other. Note the parameter description for enter image description here

Note that it will likely become possible to control tick label rotation directly through the Plot API, although rotating tick labels (especially to 90 degrees) is often not the best way to make overlapping labels readable.

  • Related