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
I have been trying to plot continuous data with a log-scaled x-axis and a secondary x-axis in order to display ticks values in another unit.
It seems to me that the ticks positions of this secondary axis are not correctly computed.
Hmm... I know where the problem lies, but I'm unsure what the best approach is to fix it.
Basically, the way the secondary axis works without requiring the user to supply a reverse transform is that it calculates the position for 1000 points evenly spaced in the original range and choses the ones closest to the breaks. The log transform of the original axis makes the uniformly distributed points very very coarse on the left side resulting in the strange bug observed.
Increasing the number of points is unfeasible. Using 1e5 only fixes one tick and is already taxing on the render time. Thus, a whole new approach is needed...
I'll mull over this some more, but if someone hase some great insight I'll be happy to hear it
That would be the last resort, but I would prefer something more elegant. I'll need to find a way to sample point uniformly over the transformed range instead but all of this code is quite distant so I'll have to think a bit🙂
Activity
hadley commentedon Jan 25, 2017
@thomasp85 can you take a look?
thomasp85 commentedon Apr 3, 2017
Hmm... I know where the problem lies, but I'm unsure what the best approach is to fix it.
Basically, the way the secondary axis works without requiring the user to supply a reverse transform is that it calculates the position for 1000 points evenly spaced in the original range and choses the ones closest to the breaks. The log transform of the original axis makes the uniformly distributed points very very coarse on the left side resulting in the strange bug observed.
Increasing the number of points is unfeasible. Using 1e5 only fixes one tick and is already taxing on the render time. Thus, a whole new approach is needed...
I'll mull over this some more, but if someone hase some great insight I'll be happy to hear it
hadley commentedon Apr 3, 2017
Maybe we could optionally allow supplying the inverse?
thomasp85 commentedon Apr 3, 2017
That would be the last resort, but I would prefer something more elegant. I'll need to find a way to sample point uniformly over the transformed range instead but all of this code is quite distant so I'll have to think a bit🙂
thomasp85 commentedon Apr 3, 2017
Oh, but that is actually easy — I'll make a fix tomorrow
Sample points uniformly from transformed space (#2095)
amignan commentedon Dec 11, 2017
Hi, I'm observing the same bug. I updated to the latest version of ggplot2 at no avail. Is the fix published? Thanks
jacobgrasmick commentedon May 20, 2018
I also am observing this bug. Has it been fixed? I'm using version 2.2.1
Thanks!
clauswilke commentedon May 20, 2018
This seems to work as expected in the development version, which is currently being prepared for release as 2.3.0.
Created on 2018-05-20 by the reprex package (v0.2.0).
Session info
lock commentedon Nov 16, 2018
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/