'How to add a secondary Y-axis label in facetgrid using seaborn
Running this code below provides two Y-axis (first and secondary) on facetgrid. The problem I am trying to resolve is to include the second Y-axis label. I have the first Y-axis label in the facetgrid plot but not able to capture the second Y-axis label. Any help would be great.
g = sns.FacetGrid(merged,col="PATIENT ID", col_wrap=4, size=5,height=1, aspect=1, sharex=False,sharey=True,hue='TEST', palette='Set1')
g.map(sns.lineplot,"Days Post-ART", "logarithm_base10")
ax1 = ax.twinx()
for patid, ax in g.axes_dict.items():
ax1 = ax.twinx()
sns.lineplot(merged=merged[merged['PATIENT ID'] == patid],ax1=ax)
g.set_axis_labels("Days Post-Therapy", "Log Viral Load")
g.fig.tight_layout()
g.add_legend()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
