| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Interestingly, ax.plot(np.arange(2000, 2010), range(10)) does not result in any offset with current matplotlib. Hence this needs to change anyways for the whole paragraph to make sense. So suppose it is ax.plot(np.arange(20000, 20010), range(10)) instead. Then, using ax.get_xaxis().get_major_formatter().set_useOffset(False) does indeed get rid of the offset, just as currently described in that part. Concerning the "multiplicative offset", another example can be added. E.g. if ax.plot(np.linspace(0, 3e8, 301), range(301)) then adding ax.get_xaxis().get_major_formatter().set_scientific(False) will remove the "multiplicative offset". The difference between the two is not well documented anywhere. So it would in addition make sense to add a respective paragraph in the ticks-and-ticklabels section of the text tutorial. |
Sorry, something went wrong.
There was a problem hiding this comment.
I'm blocking this. set_scientific is not correct here. This is a misconception originating in poor docs. See linked PRs.
Sorry, something went wrong.
|
Thanks a lot. If you fix the matplotlib behavior in order to provide 2 independent concepts for offset and scientific notation, it is far better. But if you only update the docstring, you only provide documentation which do not match the actual matplotlib behavior. So, do you plan to fix the behavior? Is there a related issue i can follow? Thanks a lot. |
Sorry, something went wrong.
|
Definitely not. Else, disabling scientific notation should not be needed to disable the offset. This said, i did not checked it again since January. |
Sorry, something went wrong.
|
Oh, yes, in fact the issue was on my PR description: #16232 |
Sorry, something went wrong.
|
I see, there is an offset and a factor. Thanks a lot for the clarification. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
This PR update the example from the documentation to use the proper function to avoid using scientific offset in the plot.
Relative to this discussion #16232
Closes #16232
Fill free to close this PR and the related issue if it do not fit.
PR Checklist