0

I'd like to move down the subtitles in order to generate less confusion.

import seaborn as sns; sns.set(style="ticks", color_codes=True)
import pandas as pd
import matplotlib.pyplot as plt
import warnings; warnings.filterwarnings(action='once')
from scipy import stats
import numpy

df = pd.read_csv("serieA.csv")
df['dxG'] = df['xG'] - df['xGA']
df['dG'] = df['GF'] - df['GA']
df.head()


#%%
sns.set_palette("husl")
g = sns.FacetGrid(df, col="Squadra", hue="Venue", col_wrap=5, hue_order=["Home", "Away"]) 
g.map(sns.distplot, 'dxG', hist=False, kde=True, kde_kws={'kernel':'gau','shade':'True'} ).set_titles("{col_name}").add_legend()

for ax in g.axes:
    ax.title.set_position([0.5, 2])

plt.xlim(-6,6)
plt.ylim(0,1)
plt.show()

Now I have this plot:

plot

How can I move down the subtitles position?

smci
  • 32,567
  • 20
  • 113
  • 146
  • 1
    Does this answer your question? [Move seaborn plot legend to a different position?](https://stackoverflow.com/questions/27019079/move-seaborn-plot-legend-to-a-different-position) – smci Apr 19 '20 at 10:23
  • The question you ask in the title differs from the one you ask at the end of the question. What do you want know now? – MERose Feb 28 '23 at 10:39

1 Answers1

0

If you are talking about the legend, then you can do it by specifying the legend position using the below code.

Code:

plt.legend(loc='lower right')

This will move the legend to lower right position. You can also choose any of the following as you want;

best
upper right
upper left
lower left
lower right
right
center left
center right
lower center
upper center
center

I hope it would be helpful.

Littin Rajan
  • 852
  • 1
  • 10
  • 21
  • Sorry, I didn't explain it well. I'd like to edit the position of the name of each column, that is the team name (col='Squadra') – Martino Vignali Apr 20 '20 at 07:02