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
While I was trying to making a variant of guide_axis() that displays tick marks at minor breaks (see for example SO), I stumbled on a possible bug in coord_trans() and coord_polar(), which appear to ignore position guides.
Standard cartesian coordinates seem to work just fine.
@paleolimbot
I didn't actively follow the discussion about ViewScale (sorry...), do you think we can support position guides on other coords than CoordCartesian?
No prob! The ViewScale exists because of the SecAxis...both get a ViewScale even though there's only one Scale. I'd prefer the ViewScale not to exist (and have second axes live in the guides framework), but it's designed to be interface-compatible with Scale so that we don't have to rewrite everything if we go that direction.
I think the general idea was to test the guide_axis() stuff with CoordCartesian, but there's no reason (I think) that it couldn't be implemented in the other coords as well. If that's something that would be welcome (and the PR would get reviewed), I could give it a shot (or you could...no problem either way).
Thanks, then let me try a PR this time. This would be a nice lesson to get familiar with coords and guides (and even if I fail, the experience should be useful to review your PRs...).
Activity
yutannihilation commentedon Apr 23, 2020
Thanks, confirmed.
Currently, the
titleofguideis referenced only byCoordCartesian$label()viapanel_guide_label():ggplot2/R/coord-cartesian-.r
Lines 154 to 173 in d3d47be
ggplot2/R/coord-cartesian-.r
Lines 217 to 220 in d3d47be
The other
Coordclasses use the inheritedCoord$label():ggplot2/R/coord-.r
Line 62 in d3d47be
But, it seems we cannot simply transplant the
label().panel_paramsdoesn't containguidesby default, so we needsetup_panel_guides()to add it.ggplot2/R/coord-cartesian-.r
Line 134 in d3d47be
Besides,
guidesneeds to haveposition, otherwiseguide_for_position(guides, position)returnsNULL.ggplot2/R/coord-cartesian-.r
Lines 128 to 130 in d3d47be
To enable this, we need to include
scaleinpanel_params, which is currently done only inCoordCartesian:ggplot2/R/coord-cartesian-.r
Lines 99 to 104 in d3d47be
e.g.
CoordTransdoesn't includeViewScale.ggplot2/R/coord-transform.r
Lines 138 to 143 in d3d47be
ggplot2/R/coord-transform.r
Lines 217 to 227 in d3d47be
@paleolimbot
I didn't actively follow the discussion about
ViewScale(sorry...), do you think we can support position guides on other coords thanCoordCartesian?paleolimbot commentedon Apr 23, 2020
No prob! The
ViewScaleexists because of theSecAxis...both get aViewScaleeven though there's only oneScale. I'd prefer theViewScalenot to exist (and have second axes live in the guides framework), but it's designed to be interface-compatible withScaleso that we don't have to rewrite everything if we go that direction.I think the general idea was to test the
guide_axis()stuff withCoordCartesian, but there's no reason (I think) that it couldn't be implemented in the other coords as well. If that's something that would be welcome (and the PR would get reviewed), I could give it a shot (or you could...no problem either way).yutannihilation commentedon Apr 23, 2020
Thanks, then let me try a PR this time. This would be a nice lesson to get familiar with coords and guides (and even if I fail, the experience should be useful to review your PRs...).
yutannihilation commentedon Jul 27, 2022
coord_trans()was fixed by #3972.coord_polar()(and other coords) stays the same.