I'm having trouble removing the original legend from Relplot.
Since I want to change the text in the legend, I added some code to override the legend and now I want to get rid of the original one. However I can't write legend = False
since, if so, it wouldn't give the added legend as well. Any suggestion?
sns.relplot(data = df_R_subject1, x="CDL-07_CO2", y="CDL-07_Ta", size="freshair_S1", hue="posture_S1",
sizes=(200, 50), alpha=.5, palette="muted", height=6)
L = plt.legend(bbox_to_anchor = (1,0.35), frameon=False)
L.get_texts()[0].set_text('Posture')
L.get_texts()[1].set_text('Standing')
L.get_texts()[2].set_text('Sitting')
L.get_texts()[3].set_text('Do you need fresh air?')
L.get_texts()[4].set_text('Yes')
L.get_texts()[5].set_text('No change')
plt.ylabel("Air temperature (°C)", fontsize = 12)
plt.xlabel("CO2 concentration (ppm)", fontsize = 12)
plt.show()
Example plot:
How can I get rid of the legend (right side)?