-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[ENH]: ticker.EngFormatter: allow offset #28463
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
Comments
I think mirroring the I am pretty 👎🏻 on picking up a dependency though. |
Yea sure, I was thinking about that the same,
OK I agree with that, in terms of the UX/UI of the library, I'd imagine this kind of usage: ax.yaxis.set_major_formatter(EngFormatter(
# Perhaps this should be the default value?
useOffset=True
)) The dilemma I'm facing though when I'm thinking of implementing this feature, is the fact that most of the code that computes constantly the data's Hence I'm not sure in to which class to put the functions that compute the order of magnitude and the offset. Perhaps I should make |
Rather than go down the complexity of OO inheritance choices, I suggest we pull the re-usable code out into |
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
It was pretty hard to implement this without subclassing |
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves matplotlib#28463.
* ticker.ScalarFormatter: allow changing usetex like in EngFormatter * ticker.EngFormatter: base upon ScalarFormatter Allows us to use many order of magnitude and offset related routines from ScalarFormatter, and removes a bit usetex related duplicated code. Solves #28463. * Fix small documentation issues from QuLogic's review * Small comment fixups from review * test_ticker.py: small cleanups after review * ticker.py: small cleanups after review * ticker.ScalarFormatter: Fix type hints & document new attributes * engformatter_offset.rst: fix title * engformatter related small fixes * test_engformatter_offset_oom: parametrize center & noise directly
Problem
I want to be able to generate this plot:
I managed to create this plot using the following code:
It is not ideal because it relies both upon modifying (the private)
_set_order_of_magnitude
method and the external libraryprefixed
, which implements something already implemented in theEngFormatter
.I'm surprised that
EngFormatter
doesn't handle offsets so smartly likeScalarFormatter
...Where do you think this kind of enhancement would fit most? In
EngFormatter
with an additional__init__
argument? Or in a new formatter?Proposed solution
Sort of proposed above...
The text was updated successfully, but these errors were encountered: