Add a 'useMathText' param to method 'ticklabel_format' #6337

Merged
merged 3 commits into from Apr 29, 2016

Conversation

Projects
None yet
4 participants
Contributor

gepcel commented Apr 26, 2016

As discussed in #6330. Can anyone examine this?

@gepcel gepcel Add a 'useMathText' param to method 'ticklabel_format'
as discussed in #6330
90d9539

mdboom added the needs_review label Apr 26, 2016

Contributor

gepcel commented Apr 26, 2016

Now we can do like:

plt.plot(1, 10000, 2, 20000, 'ro')
ax = plt.gca()
ax.ticklabel_format(scilimits=(-3, 3), useMathText=True)
plt.show()

or:

plt.plot(1, 10000, 2, 20000, 'ro')
ax = plt.gca()
fmt = ax.yaxis.get_major_formatter()
fmt.set_useMathText(True)
#or fmt.useMathText = True
fmt.set_powerlimits((-3, 3))
plt.show()
@gepcel gepcel fix pep8
Add and remove some whitespace.
0582cd9
Member

QuLogic commented Apr 26, 2016

It would be nice to be more PEP8-y on the name, but I don't know if we want to just leave it to be consistent with the existing name. Or perhaps some deprecation notice would be possible on the original name...

tacaswell added this to the 2.1 (next point release) milestone Apr 26, 2016

@gepcel gepcel fix a malformed table
add more whitespaces to fix a malformed table.
Text in column margin.
d87e38d
Contributor

gepcel commented Apr 27, 2016

Hi, @QuLogic . I'm not sure I understand you. Can you explain more? What should I do?

Member

QuLogic commented Apr 27, 2016

The comment is not a suggestion for you; it's a question for the other devs.

Owner

tacaswell commented Apr 29, 2016

making the names more pythonic is a good fight, but one that is beyond the scope of this PR. I think the standard practice in these cases is to stay consistent with the local naming and do the renaming/deprecation in a separate PR.

@tacaswell tacaswell merged commit 094007f into matplotlib:master Apr 29, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

tacaswell removed the needs_review label Apr 29, 2016

gepcel deleted the gepcel:useMathText branch Apr 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment