We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am plotting a kde plot using the seaborn kdeplot.
time_window_order=['272','268','264','260','256','252','248','244','240'] order_dict = {k:i for i,k in enumerate(time_window_order)} df =DataFrame ({'time_window':['268','268','268','264','252','252','252','240', '256','256','256','256','252','252','252','240'], 'seq_no':['a','a','a','a','a','a','a','a', 'b','b','b','b','b','b','b','b']}) df['centre_point'] = df['time_window'].map(order_dict) g =sns.kdeplot(data=df, x="centre_point",hue='seq_no', bw_adjust=0.8);plt.xlim(0,len(time_window_order)-1);plt.grid() g.legend(loc='center left', bbox_to_anchor=(1, 0.5)) # move legend outside the box plt.xticks(ticks = range(0,len(time_window_order)) ,labels = time_window_order, rotation = 'vertical') plt.show()
I tried reposition the legend outside the box using the line g.legend(loc='center left', bbox_to_anchor=(1, 0.5)) [link].
Instead, the compiler return an error
No handles with labels found to put in legend.
Also, instead of complete legend, the legend appear to become like a small rectangle as shown by the red arrow, in the figure attached .
May I know how to fix this or whether this is bug?
The text was updated successfully, but these errors were encountered:
It is the same question as #2280
More information there, but I would suggest using displot if you want the legend outside of the plot and it otherwise works for you.
displot
Sorry, something went wrong.
It is the same question as #2280 More information there, but I would suggest using displot if you want the legend outside of the plot and it otherwise works for you.
Thanks for suggesting the displot
No branches or pull requests
I am plotting a kde plot using the seaborn kdeplot.
I tried reposition the legend outside the box using the line g.legend(loc='center left', bbox_to_anchor=(1, 0.5)) [link].
Instead, the compiler return an error
No handles with labels found to put in legend.
Also, instead of complete legend, the legend appear to become like a small rectangle as shown by the red arrow, in the figure attached
.
May I know how to fix this or whether this is bug?
The text was updated successfully, but these errors were encountered: