X Tutup
Skip to content

Update bachelors_degree_by_gender example.#6874

Merged
tacaswell merged 1 commit intomatplotlib:masterfrom
anntzer:update-bachelors-degree-by-gender
Aug 1, 2016
Merged

Update bachelors_degree_by_gender example.#6874
tacaswell merged 1 commit intomatplotlib:masterfrom
anntzer:update-bachelors-degree-by-gender

Conversation

@anntzer
Copy link
Copy Markdown
Contributor

@anntzer anntzer commented Jul 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.

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.
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))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can simply use '{:.0%}'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, because this would multiply the entries by 100 (they are in [0, 100], not [0, 1]).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ahh, yes, sorry.

@tacaswell tacaswell merged commit 0cfc7a8 into matplotlib:master Aug 1, 2016
tacaswell added a commit that referenced this pull request Aug 1, 2016
DOC: Update bachelors_degree_by_gender example.
@tacaswell
Copy link
Copy Markdown
Member

backported to v2.x as be37777

@anntzer anntzer deleted the update-bachelors-degree-by-gender branch August 1, 2016 03:01
@QuLogic 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup