You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
linscalex/linscaley (for symlog) behaviour and documentation #10369
According to the documentation linscalex/linscaley "is the number of decades to use for each half of the linear range." This may be correct for base 10* (incidentally the documentation does not specify that this is the default base) but with a general base b it seems not to be, nor for a 'b-ade' as opposed to a decade. Also, there is a natural value log(e)/log(b) for this scaling (relative to the 'b-ade') which makes the scale continuous at the threshold and hence does not introduce gradient jumps in smooth curves. This may be a better default than 1.
On further investigation inspired by issue #7008, it appears that _linscale_adj is indeed the culprit. Premultiplying by (1 - 1/b), i.e. the inverse of the adjustment factor, seems to eliminate the discrepancies and also reveals that it means "the number of b-ades" (not decades) in general. Suggest the following three actions:
Remove this adjustment factor; or at least (if it is needed for some other purpose) document both it and the above fix, and perhaps provide a parameter to perform the fix automatically
In the documentation, change decade to b-ade for a general base b
Consider changing the default value from 1 to log(e)/log(b)
Note that with these changes, apart from tick labelling the default appearance would not depend on base.
There are various equivalent choices that could be made instead of actions 2 and 3, e.g. a factor 1/log10(b) could be incorporated into the code so that linscalex/linscaley really does mean decade (as the documentation now says), and the default changed to log10(e) if desired; or a factor 1/ln(b) could be incorporated and the default left as 1 (but then the documentation should say whatever an 'e-ade' is called). Action 3 above or this second variant (but without reference to the documentation) was proposed as item 2 of issue #2288, but that issue seems to have been closed after only item 1 was done.
Minimally either the documentation or the code needs to change; but preferably both.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
I’m going to re-open this one: the problem was clearly described with a reproducing example, so it would be good to at least check whether it still exists.
As OP points out, setting linscale=np.log10(np.e) in the middle plot does produce smooth curves. OP suggests that would therefore be a better default, though the current default is clearly simpler.
The linear range between y=-1 and y=1 on the base 2 plot (right) is smaller than the documented 2 decades in the log range and also larger than 2 powers of 2 in the log range.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
gregcolyer commentedon Feb 2, 2018
On further investigation inspired by issue #7008, it appears that _linscale_adj is indeed the culprit. Premultiplying by (1 - 1/b), i.e. the inverse of the adjustment factor, seems to eliminate the discrepancies and also reveals that it means "the number of b-ades" (not decades) in general. Suggest the following three actions:
gregcolyer commentedon Feb 2, 2018
Note that with these changes, apart from tick labelling the default appearance would not depend on base.
There are various equivalent choices that could be made instead of actions 2 and 3, e.g. a factor 1/log10(b) could be incorporated into the code so that linscalex/linscaley really does mean decade (as the documentation now says), and the default changed to log10(e) if desired; or a factor 1/ln(b) could be incorporated and the default left as 1 (but then the documentation should say whatever an 'e-ade' is called). Action 3 above or this second variant (but without reference to the documentation) was proposed as item 2 of issue #2288, but that issue seems to have been closed after only item 1 was done.
Minimally either the documentation or the code needs to change; but preferably both.
jgehrcke commentedon Jun 26, 2019
Just a user who ran into this topic. Thank you for documenting your insights.
gregcolyer commentedon Jul 19, 2019
Cheers. The documentation does now state that the default base is 10, but the rest is probably still outstanding.
github-actions commentedon May 1, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
rcomer commentedon May 31, 2023
I’m going to re-open this one: the problem was clearly described with a reproducing example, so it would be good to at least check whether it still exists.
rcomer commentedon May 31, 2023
The API has moved on a little, so I think the code in the OP should now be like this (I also added a legend):
Using
main:Things to note
linscale=np.log10(np.e)in the middle plot does produce smooth curves. OP suggests that would therefore be a better default, though the current default is clearly simpler.github-actions commentedon Jul 3, 2024
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!