I am trying to adjust the legend markers in a Seaborn jointplot. Based on the answer by "MaozGelbart" on this Github issue, I expected rcParams
to work for this. The configurations are in the matplotib documentation here, and I think legend.markerscale
is the parameter I am interested in.
How can I change the legend marker scale? This code below does not work. However, it does work for the legend.fontsize
parameter.
import pandas as pd
import seaborn as sns
d = {
'x': [3,2,5,1,1,0],
'y': [1,1,2,3,0,2],
'cat': ['a','a','a','b','b','b']
}
df = pd.DataFrame(d)
with sns.plotting_context(rc={"legend.fontsize": 'x-small', "legend.markerscale": 0.5}):
g = sns.jointplot(data=df, x='x', y='y', hue='cat')
There is a similar Stack Overflow question here but it looks like there is no clear answer. Besides, setting rcParams
should work, in theory