-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
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
Add lineplot function #1285
Add lineplot function #1285
Conversation
71695fc
to
3b45948
Compare
Codecov Report
@@ Coverage Diff @@
## master #1285 +/- ##
==========================================
+ Coverage 93.86% 94.23% +0.36%
==========================================
Files 14 15 +1
Lines 3814 4214 +400
==========================================
+ Hits 3580 3971 +391
- Misses 234 243 +9
Continue to review full report at Codecov.
|
Can we have the ability to specify the uncertainties rather than using bootstrapping? |
@beojan no, sorry, that's not the way things work in seaborn |
5d07870
to
277ebd7
Compare
Temporary (hopefully) workaround for https://stackoverflow.com/questions/47514043/
This PR adds a major new function,
lineplot
, that replacestsplot
while behaving much more like other seaborn functions (the categorical plotters) and adding some new capabilities (subsetting with different visual semantics on up to three dimensions, mapping thehue
variable numerically, and handling dates properly).The basic signature is similar to other functions:
lineplot(x, y, <semantic mappers>, data, <control kwargs>)
but with three parameters that determine subsetting/semantic mapping:
hue
,size
, andstyle
. These operate independently, so you can in principle show up to five variables on one plot (but be careful: many such plots will be very hard to interpret). The multiple semantics should also make it easy to generate plots that are accessible (i.e. using more than just color to map some variable) without much effort.Here are some quick examples. For more information, I've copied the new tutorial notebook source to a gist.
What's more, most of the underlying architecture is going to be re-used to support a forthcoming
scatterplot
function that will behavior similarly while drawing scatterplots instead of line plots. However because that's not implemented yet, it's possible that doing so will force some small changes inlineplot
behavior. That means I wouldn't uselineplot
in production quite yet, but definitely start throwing some real datasets at it.TODO
tsplot
deprecation messageRelated TODOs outside the scope of this PR:
scatterplot
hue
data: current behavior uses the rcParams image colormap (like matplotlib functions), but this is often suboptimal for lines/points because it often includes high luminance colors that give very low contrast with the background. Ideally matplotlib 2.0 would have had different colormaps for image/object data, but this was unfortunately rejected.units
for faster bootstrapping in the case of repeated measures dataunits
to draw multiple unconnected lines with the same semantics (e.g. to plot individual subject data without differentiating) #