Feature request: Add argument "fill" to lineplot()
See original GitHub issuekdeplot() offers an argument fill. It would be nice to offer this argument to lineplot() as well.
sns.lineplot(
data=data, x="x", y="y", hue="category", fill=True, palette="crest", alpha=.5, linewidth=0
)
(image from kdeplot docu)
Keep in mind that the lineplot can be used in the context of a polar plot (axis projection: “polar”).
PS: happy New Year!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How do I create a multiline plot using seaborn? - Stack Overflow
This: sns.lineplot(data=data_preproc). will do what you want.
Read more >Pandas Line Plot | Python - Machine Learning Plus
Pandas provides you a quick and easy way to visualize the relationship between the features of a dataframe. The Pandas line plot represents ......
Read more >Python Seaborn Data Visualization Tutorial for Beginners
Python Seaborn Complete Tutorial for Beginners. Seaborn Line Plot | Python Seaborn Data Visualization Tutorial for Beginners.
Read more >Line chart - The R Graph Gallery
ggplot2 allows to draw line charts thanks to the geom_line() function. It expects as input a data frame with 2 numeric variables, one...
Read more >A Complete Guide to Plotting Categorical Variables with ...
There are lots of questions to ask and relationships between ... can take an added hue argument to add another variable for comparison....
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 Free
Top 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
Not really, because seaborn does all of its theming through the matplotlib rc system, which pandas plots also pick up. So if you set a theme “in seaborn”, it will affect pandas plots too.
I don’t think it makes much sense to have a
lineplot
that draws areas …lineplot
uses filling to represent uncertainty which is different (in tension with, actually) using it to represent the quantity.But … on the user side it’s easy to define a simple function that adds fills to a line plot, e.g. something like
If you have that sitting in a personal function library, you can call it after you make a lineplot and it will add fills that match the lines in your plot, essentially just as you’d like.
I am -1 on adding this to
lineplot
, but am somewhat open to the idea of anareaplot
. There are a few things one would need to think about though:lineplot
andscatterplot
supporthue
,size
, andstyle
. It’s not obvious how to addsize
andstyle
. Well, withstyle
, you could do hatching, but I have been reluctant to add hatching to seaborn because of limitations in the matplotlib API for hatches. Perhaps it would be possible to relax the constraint, but it’s the kind of thing that would add some complexity and so would need a good motivation.areaplot
cookie is that they would want some “stacked” area plot milk. The logic that does stacking for filled densities or histograms assumes a different internal representation of the data than is in the relational plots. On a medium-long term time horizon, I’d like to make that more general, but I’d consider that a prerequisite to adding this.So if the question is “should seaborn have an area plot that can’t do aggregation/errorbars and only has
hue
semantic mapping” my answer would probably be no because that exists in pandas builtin plotting and I try not to devote effort to straight up duplication of plots you can already make with matplotlib or pandas. If some of these problems can be solved, I’d consider it worth adding to seaborn. But it’s a low priority right now.