Font size of axial marks in nautical

In a marine garden, how can you only change the font size of the x and y labels? Instead of using the "set context" method, is there a way to specifically change only the axis labels? Here is my code:

def corrfunc(x, y, **kws):

    r = stats.pearsonr(x, y)[0] ** 2
    ax = plt.gca()
    ax.annotate("r$^2$ = {:.2f}".format(r),
                xy=(.1, .9), xycoords=ax.transAxes, fontsize=16)
    if r > 0.6:
        col = 'g'
    elif r < 0.6:
        col = 'r'
    sns.regplot(x, y, color=col)
    return r

IC_Plot = sns.PairGrid(df_IC, palette=["red"])
IC_Plot.map_offdiag(corrfunc)

IC_Plot.savefig("Save_Pair.png")
+4
source share
1 answer

The easiest way to change the font of all x- and y-labels on the chart is to use the rcParams property "axes.labelsize"at the top of the script, for example

plt.rcParams["axes.labelsize"] = 15

You can also set the font size for each individual label.

for ax in plt.gcf().axes:
    l = ax.get_xlabel()
    ax.set_xlabel(l, fontsize=15)
+5
source

Source: https://habr.com/ru/post/1675868/


All Articles