-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: switch to O-O interface in basic examples #7066
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
DOC: switch to O-O interface in basic examples #7066
Conversation
for color in ['red', 'green', 'blue']: | ||
n = 750 | ||
x, y = rand(2, n) | ||
scale = 200.0 * rand(n) | ||
plt.scatter(x, y, c=color, s=scale, label=color, | ||
ax.scatter(x, y, c=color, s=scale, label=color, | ||
alpha=0.3, edgecolors='none') |
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.
Need to adjust indent for alpha
?
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.
@dopplershift Ahh yes. Good catch. I'll wait for the CI to wrap up before pushing again.
plt.xlabel('Performance') | ||
plt.title('How fast do you want to go today?') | ||
ax.barh(y_pos, performance, xerr=error, align='center', | ||
color='green', ecolor='black') |
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.
There seems to be an indentation problem here.
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.
Or a tab & space problem.
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.
oh geez -- that's embarrassing.
Apart from my comments, this looks good! |
f8b02f6
to
a9fec83
Compare
whoops -- had to restore the labels on the |
plt.yticks(y_pos, people) | ||
plt.xlabel('Performance') | ||
plt.title('How fast do you want to go today?') | ||
ax.barh(y_pos, performance, xerr=error, align='center', |
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.
If we do not want to backport this to v2.x, this can use @story645 's categorical work. ax.barh(people, performance)
should 'just work'
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.
I am in favor of merging now and backporting, and create another PR for the categorical bar plot.
DOC: switch to O-O interface in basic examples Conflicts: examples/lines_bars_and_markers/barh_demo.py whitespace vs new code
Thanks! backported to v2.x as 215fbd1 |
Small PR to limit the calls to
plt
in the lines, bars, and markers example.Took some artistic liberties:
ax.plot
for this examplecolor
andecolor
I think that about covers it.