-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add stackplot to plot types listing #23062
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
Conversation
I'm not in favour of plot_types being an exhaustive list -- its meant to be a quick reference for what Matplotlib can do. In particular |
I agree that it shouldn't be an exhaustive list of axes methods, and I agree that it should be a quick reference, but I think of it as being akin to excel's chart types directory and that it is mostly a reference for the methods on axes that are the charts Matplotlib makes out of the box. I think an area plot is conceptually unique enough to warrant its own entry. For example, if a user wanted to make an area plot, it's far more likely we'd direct them to ax.stackplot than to fill between. |
Yes, I could easily be convinced to remove |
I'd argue for the opposite. "Plot types" is a brilliant starting point to see how one can easily do things. So even though some functions are only wrappers, they are wrappers for something (hopefully) useful. So for a new user to see all these examples is much easier that trying to figure out that e.g. a stem-plot can be created using two separate plots (which they may try to do if With the reservation that we probably should try to keep the list reasonably short, but |
ce6298e
to
b2c2372
Compare
plot_types/basic/stackplot.py
Outdated
# plot | ||
fig, ax = plt.subplots() | ||
|
||
ax.stackplot(x, y, labels=labels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current colours are quite stark compared to the rest of this section, though they are the same as the next section, so maybe it is OK? If it were me, I'd apply an alpha, probably in the cycle?
I clicked through to stackplot and its description of the y parameter is somewhat enigmatic. I would not have assumed that the third plotted "line" was the cumulatively summed with the first two.
Um, does anybody know why the style changes between devdocs and this PR? |
Yeah, @story645 changed the color cycle |
Oops, I enabled the color cycle (it was turned off), but I can reverse the colors to be dark to light and that should make the other ones kick in? 8000 I guess before they were relying on the colormap but cycler takes precedence? (Is there a way to specify which artists should use which color cycle? |
It was using the default color cycle before. |
ETA: had to change the color cycle to get stackplot in blues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only some minor cleanup left.
…e guide using Blues cmap
Thanks @story645! |
Area plots (stackplots) are a fairly common plot type, so I figure should be included in the plot type listing. They're structurally similar to fill_between, which is why I put this in the same 'basic' section
eta: no idea why my rebase/squash isn't working (it is locally) so folks are welcome squash.
eta2: no idea what combination of button mashing got me to a clean commit