-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Implemented issue #5856 #6172
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
Implemented issue #5856 #6172
Changes from all commits
5c97b0c
410ef24
90453d1
e7cc3a5
a4cdd2f
dd834fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2364,8 +2364,10 @@ def stem(self, *args, **kwargs): | |
|
||
Call signatures:: | ||
|
||
stem(y, linefmt='b-', markerfmt='bo', basefmt='r-') | ||
stem(x, y, linefmt='b-', markerfmt='bo', basefmt='r-') | ||
stem(y, linefmt='b-', markerfmt='bo', basefmt='r-', | ||
orientation={'vertical'|'horizontal'}) | ||
stem(x, y, linefmt='b-', markerfmt='bo', basefmt='r-', | ||
orientation={'vertical'|'horizontal'}) | ||
|
||
A stem plot plots vertical lines (using *linefmt*) at each *x* | ||
location from the baseline to *y*, and places a marker there | ||
|
@@ -2419,24 +2421,37 @@ def stem(self, *args, **kwargs): | |
basefmt = kwargs.pop('basefmt', args[2]) | ||
except IndexError: | ||
basefmt = kwargs.pop('basefmt', 'r-') | ||
try: | ||
orientation = kwargs.pop('orientation', args[3]) | ||
except IndexError: | ||
orientation = kwargs.pop('orientation', 'vertical') | ||
|
||
bottom = kwargs.pop('bottom', None) | ||
label = kwargs.pop('label', None) | ||
|
||
markerline, = self.plot(x, y, markerfmt, label="_nolegend_") | ||
if (orientation == "vertical"): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary parentheses. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @QuLogic Hi I think it need both vertical and horizontal check there or else it will plot marker lines twice, unless you meant a else statement instead of elif like: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parentheses, not condition: if orientation == 'vertical': |
||
markerline, = self.plot(x, y, markerfmt, label="_nolegend_") | ||
elif (orientation == "horizontal"): | ||
markerline, = self.plot(y, x, markerfmt, label="_nolegend_") | ||
|
||
if bottom is None: | ||
bottom = 0 | ||
|
||
stemlines = [] | ||
for thisx, thisy in zip(x, y): | ||
l, = self.plot([thisx, thisx], [bottom, thisy], linefmt, | ||
if (orientation == "vertical"): | ||
l, = self.plot([thisx, thisx], [bottom, thisy], linefmt, | ||
label="_nolegend_") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unaligned with opening parenthesis. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for this, do you mean "label=" has to be under [thisx,thisx... at line 2443? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! |
||
elif (orientation == "horizontal"): | ||
l, = self.plot([bottom, thisy], [thisx, thisx], linefmt, | ||
label="_nolegend_") | ||
stemlines.append(l) | ||
|
||
baseline, = self.plot([np.amin(x), np.amax(x)], [bottom, bottom], | ||
if (orientation == "vertical"): | ||
baseline, = self.plot([np.amin(x), np.amax(x)], [bottom, bottom], | ||
basefmt, label="_nolegend_") | ||
elif (orientation == "horizontal"): | ||
baseline, = self.plot([bottom, bottom], [np.amin(x), np.amax(x)], | ||
basefmt, label="_nolegend_") | ||
|
||
self.hold(remember_hold) | ||
|
||
stem_container = StemContainer((markerline, stemlines, baseline), | ||
|
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.
👎 on adding it as a possible positional.