Skip to content
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

adds rcParam axes.formatter.useoffset #2401

Merged
merged 1 commit into from Nov 8, 2013

Conversation

tacaswell
Copy link
Member

Addresses issue #2400

@tacaswell
Copy link
Member Author

The build errors look un-related to this (and related to the six conversion or locale issues).

Controls the default value of `useOffset` in `ScalarFormatter`. If
`True` and the data range is much smaller than the data average, then
an offset will be determined such that the tick labels are
meaningful.than small ranges on top of a large absolute value will be
Copy link
Member

Choose a reason for hiding this comment

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

Something is wrong here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Gah. I was starting to re-write the documentation, but then decided to just use the text from ScalarForamatter and managed to not delete my version. Fixed now.

@tacaswell
Copy link
Member Author

One of these days I will get a PR through without documentation issues....

I thought the values shown in the template were supposed to be the default value.

In terms of major changes, I think it would be better to move the comment strings to rcsetup.py and then auto-generate the template.

@pelson
Copy link
Member

pelson commented Sep 19, 2013

This doesn't automatically merge, would you mind rebasing.

I'd also like to see a test. Something as simple as mocking ScalarFormatter (untested):

for use_offset in [True, False]:
    with mock.patch('matplotlib.ticker.ScalarFormatter.set_useOffset') as set_useOffset:
        with matplotlib.rcContext({'axes.formatter.useoffset': use_offset}):
            plt.plot(range(10))
    set_useOffset.assert_called_with(use_offset)

@tacaswell
Copy link
Member Author

rebased, the conflicts were in api_changes.

I will try to get to the tests this weekend. I know nothing about mock so I suspect it will take me a while to sort out how that works.

@tacaswell
Copy link
Member Author

Is this test sufficient?

@pelson
Copy link
Member

pelson commented Sep 27, 2013

Is this test sufficient?

Yes indeed. 👍

Could you add 'mock' to the test dependencies (at https://github.com/matplotlib/matplotlib/blob/master/setupext.py#L651) and squash your commits, and I'll merge.

@tacaswell
Copy link
Member Author

I am confused by adding mock, I don't actually use it in the test.

@tacaswell
Copy link
Member Author

@pelson Can you take another look at this?

@tacaswell
Copy link
Member Author

@pelson Sorry to be a pest. Is there anything else that needs to be done on this?

Addresses issue matplotlib#2400

added test for axes.formatter.useoffset rcparam
@tacaswell
Copy link
Member Author

rebased again

@tacaswell
Copy link
Member Author

@efiring or @pelson Can one of you push the big green button on this PR so we can close #2576 and #461 ?

efiring added a commit that referenced this pull request Nov 8, 2013
adds rcParam `axes.formatter.useoffset`
@efiring efiring merged commit 7897abd into matplotlib:master Nov 8, 2013
@tacaswell tacaswell deleted the useoffset_rcparam branch November 8, 2013 04:53
@talhum
Copy link

talhum commented Nov 13, 2018

Hi. What about datetime formatter offset?

@jklymak
Copy link
Member

jklymak commented Nov 13, 2018

@talhum would you consider opening a new feature request for this?

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.

None yet

5 participants