Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Update bachelors_degree_by_gender example. #6874
Conversation
mdboom
added the
needs_review
label
Jul 31, 2016
Kojoley
commented on the diff
Jul 31, 2016
examples/showcase/bachelors_degrees_by_gender.py
| # Make sure your axis ticks are large enough to be easily read. | ||
| # You don't want your viewers squinting to read your plot. | ||
| plt.xticks(range(1970, 2011, 10), fontsize=14) | ||
| -plt.yticks(range(0, 91, 10), ['{0}%'.format(x) | ||
| - for x in range(0, 91, 10)], fontsize=14) | ||
| +plt.yticks(range(0, 91, 10), fontsize=14) | ||
| +ax.xaxis.set_major_formatter(plt.FuncFormatter('{:.0f}'.format)) | ||
| +ax.yaxis.set_major_formatter(plt.FuncFormatter('{:.0f}%'.format)) |
anntzer
Contributor
|
tacaswell
merged commit 0cfc7a8
into matplotlib:master
Aug 1, 2016
tacaswell
removed the
needs_review
label
Aug 1, 2016
tacaswell
added a commit
that referenced
this pull request
Aug 1, 2016
|
|
tacaswell |
be37777
|
|
backported to v2.x as be37777 |
anntzer
deleted the
anntzer:update-bachelors-degree-by-gender branch
Aug 1, 2016
QuLogic
added this to the
2.0 (style change major release)
milestone
Aug 1, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
anntzer commentedJul 31, 2016
Use plt.grid() instead of manually adding grid lines (this requires
slightly changing the xlims to have a similar spacing).
Use FuncFormatters instead of fixed tick labels, both for generality and so
that the interactive cursor position text is properly formatted.
Add a
show()at the end.