-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
#5856: added option to create vertically-oriented stem plots #6168
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
lib/matplotlib/axes/_axes.py
Outdated
location from the baseline to *y*, and places a marker there | ||
using *markerfmt*. A horizontal line at 0 is is plotted using | ||
*basefmt*. | ||
|
||
It is possible to create a vertically-oriented stem plot | ||
by providing vertical=True. |
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.
Can you convert this to numpydoc format and enumerate all of the things that are popped out of the kwargs in the docstring?
Is this what you were asking for regarding the flipping? |
Yes, but I think you can do the same with the other two |
@@ -2420,9 +2444,16 @@ def stem(self, *args, **kwargs): | |||
except IndexError: | |||
basefmt = kwargs.pop('basefmt', 'r-') | |||
|
|||
# Check the orientation variable to see if the user | |||
# wants a vertical or horizontal stem plot | |||
orientation = kwargs.pop('orientation', 'horizontal') |
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.
should probably do some validation here to make sure 'aardvark' or the like does not get passed in.
Is this the PR that will be the combined effort? This will also need a test + a whats_new entry. |
Yup, this is the combined PR. |
Where ever the existing tests of stemplot live is the correct place to put these. See https://github.com/matplotlib/matplotlib/tree/master/doc/users/whats_new for the whats_new entry instructions. |
Hi I'm working with @vincent-cuenca and I was wondering what the progress on this pull request is. What else is needed to complete this pull request? |
@@ -2374,17 +2376,39 @@ def stem(self, *args, **kwargs): | |||
|
|||
If no *x* values are provided, the default is (0, 1, ..., len(y) - 1) | |||
|
|||
Return value is a tuple (*markerline*, *stemlines*, | |||
*baseline*). | |||
Optional parameters: |
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.
This does not conform with numpy doc specs see #6240 for a similar fix.
If you change it to Other Parameters
it should work. As it is this section will not be in the web generated version of the docs.
See https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt for more numpy docs info.
The output from the docs build should this is in https://travis-ci.org/matplotlib/matplotlib/jobs/118347853#L1036
Apart from inline comment 👍 from me. |
This actually seemed done, but never got a final review and now needs a rebase. It'd be a reasonable good first issue for someone to revive it. |
This PR is too old to do a direct push, so I've opened a new one, noted above. |
Note, this should have closed automatically. |
This is an attempt at implementing #5856.
I introduced a 'vertical' parameter that, upon being passed as true to the stem method, creates a vertical stem plot.