''move_legend'' lost the markers for lineplot and hatch for barplot
See original GitHub issueHi there,
The move_legend indeed makes the DIY legend much more convenient and saves me a lot of effort, however, I have two small issues that bothered me a lot.
Here is my code.
g=sns.catplot(x="X", y="Y", data=data_df, kind="bar", legend=True, facet_kws={"legend_out": False})
sns.move_legend(g, "center", bbox_to_anchor=(.5, 0.05), ncol=3, title=None, frameon=False, numpoints=2)
g.fig.subplots_adjust(bottom=0.25)
Would appreciate it if you could give me some hints.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
seaborn lineplot: marker symbols missing on legend
Solution 1: Here the markers appear in the legend twice for each series. Code: import seaborn as sns fmri = sns.load_dataset("fmri") ax=sns.
Read more >Lines, bars and markers — Matplotlib 3.6.2 documentation
Hatch -filled histograms. Bar chart with gradients ... Discrete distribution as horizontal bar chart ... Mapping marker properties to multivariate data.
Read more >seaborn.lineplot — seaborn 0.12.1 documentation - PyData |
Grouping variable that will produce lines with different dashes and/or markers. Can have a numeric dtype but will always be treated as categorical....
Read more >Overlaying a line plot and a bar plot
A combination that is frequently seen is the overlay of a bar/column chart and a line chart. A typical example of this is...
Read more >“get from dictionary but if key doesn't exist then default” ...
If it is a script, you may be missing a '#! ... render_template not showing images · how to add numbers on top...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What is
self
? In any case, after editing your code so that I can run it, I am unable to reproduce the issue as I understand it:For the bar plot, are you expecting the legend to show the patches you are manually adding to the bars? They are not in the legend to begin with so you’d need to modify the legend artists too.
catplot
has thelegend_out
parameter as part of its signature and i guess that overrides what appears infacet_kws
.Thanks for the update. Interestingly, directly modifying the legend artists of
relplot
also works for me. The workaround for the barplot blank is adjusting the subplots, which also solved my problem. 😂