I am trying to add a title to Searbon lmplot.
ax = plt.axes() sns.lmplot(x, y, data=df, hue="hue", ax=ax) ax.set_title("Graph (a)") plt.show()
But I noticed that lmplot has no ax parameter. How to add title to my lmplot?
lmplot
ax
try the following:
sns.lmplot(x, y, data=df, hue="hue") ax = plt.gca() ax.set_title("Graph (a)")
# Create lmplot lm = sns.lmplot(x, y, data=df, hue="hue", ax=ax) # Access the figure fig = lm.fig # Add a title to the Figure fig.suptitle("My figtitle", fontsize=12)
As @jaykodeveloper pointed out in the comments, @MaxU answer works correctly if ax appears after:
sns.lmplot(x, y, data=df, hue="hue", ax=ax).fig.suptitle("Graph (a)")
Source: https://habr.com/ru/post/1271955/More articles:read multiple files using multiprocessing - performanceTypeError when assigning a finely cloned object to a method that calls super - javascriptAngular4 - How to set the value of a selection option dynamically - javascriptAffordable, keyboard-friendly way to remove focus style from checkbox after mouseup - javascriptGKE clusterrolebinding for admin cluster does not work with permission error - permissionsCreating an IPA file of my Xamarin application without iOS device - iosPrevent inactive 0-ary functions in Scala - scalaThe REST version of this request is not supported by this version of the storage emulator - c #Are transfer files safe? - encryptionSpark / Neo4j error: RuntimeException: java.util.Collections $ UnmodifiableRandomAccessList is not a valid external type for string schema - scalaAll Articles