Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve stackplot example #17456

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

Merged
merged 1 commit into from
Jun 9, 2020
Merged

Conversation

timhoffm
Copy link
Member

PR Summary

Slight improvements:

  • Using a "real" data example is more illustrative of the purpose of stackplot.
  • One example for streamplot is enough. We don't need to show every possible way input data can be given for a plot command. That's what the API doc is for. (Additionally, streamplot(x, y1, y2, y3, ...) is a bit MATLABesque; streamplot(x, [y1, y2, y3, ...]) is more clear.)
  • Mention streamgraphs more prominently in the title and by sectioning
  • More compact notation of the streamgraph data generation (data stays the same).

def bump(a):
x = 1 / (.1 + np.random.random())
amplitude = 1 / (.1 + np.random.random())
x = np.linspace(0, 1, m)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly the same, since linspace includes 1, but range(m) does not include m. Passing endpoint=False would match.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now rewritten the whole function so that it's hopefully more understandable.

@timhoffm timhoffm force-pushed the doc-stackplot branch 3 times, most recently from 819cdff to ee12ad2 Compare June 7, 2020 13:50
@QuLogic QuLogic merged commit 02194b6 into matplotlib:master Jun 9, 2020
@QuLogic QuLogic added this to the v3.3.0 milestone Jun 9, 2020
@timhoffm timhoffm deleted the doc-stackplot branch June 9, 2020 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants