Fix invalid transformation in InvertedSymmetricalLogTransform. #1146
+5
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The InvertedSymmetricalLogTransform was incorrect (used for "symlog" plots). There are two problems with the existing code: first, linthresh must be transformed to the target space. It is linear, but not equal to +/- linthresh in the original space. I introduced a new class member invlinthresh for the inverted linear threshold. Second, there is a parenthesis missing in the inverted formula.
This transform is likely unused by anyone, I needed it so I could add an image (imshow) to a symlog plot. Since imshow only works with linear axes, I added a second axes with twiny() but needed to be able to create a new image, appropriately scaled logarithmically. Thus, the correct inverse transform was needed so I could compute coordinates for the new linear axis.
I hope the problem and the fix are sufficiently obvious. If not I can provide a worksheet that demonstrates the problem.