The objective is to have subsets of plot on different facets which is achievable as below.
import seaborn as sns
import matplotlib.pyplot as plt
iris = sns.load_dataset("iris")
sns.displot ( data=iris, x='petal_width', col='species', col_wrap=2, bw_adjust=0.5,
kind="kde", rug=True)
plt.xticks ( fontsize=14, rotation=45, ha="right" )
plt.show()
which produce
However, I notice the
x-tick
rendering is not consistent between the top and bottom of the graph,upon setting the xticks
to 45
,
edit: Thanks to OP, the tick is now properly rotate 45 deg. However, the suggestion still have an issue when setting the xticks label. Specifically, the font size is not consistent.
The above graph was produced via the code below
import seaborn as sns
import matplotlib.pyplot as plt
iris = sns.load_dataset("iris")
g=sns.displot ( data=iris, x='petal_width', col='species', col_wrap=2, bw_adjust=0.5,
kind="kde", rug=True)
g.set_xticklabels(rotation=45)
header_name =['1a','1b','1c','1d']
value_tick = [0.5,1,1.5,3]
g.set_xticklabels ( rotation=45 )
plt.xticks ( fontsize=14, ticks=value_tick, labels=header_name, ha="right" )