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
As currently implemented, mirror_ticks(p) works by subclassing p$facet, but meanwhile the current implementation of ggplot's + operator handles p + facet_* by overwriting p$facet entirely. This means refaceting a previously-mirrored plot will produce an unmirrored plot.
Current workarounds: Adopt a style where you call mirror_ticks last thing before plotting, or else wrap additional mirror_ticks calls around any downstream facet changes:
p = mirror_ticks(ggplot(...) + ... )
p = p + ...
...
p = mirror_ticks(p+facet_wrap(...))
Possible more complete fixes:
Mask + with a version that adds mirroring back on after rewriting a facet?
Subclass the facet_* functions? Major API change, but might allow a nicely gg-ish interface:
p + facet_wrap_ticks(~fac, sides="trbl")
p + facet_grid_ticks(f1~f2, scales="free_y", sides="lr", allPanels=TRUE)
p + facet_null_ticks() #...might want a better name for the one-panel case, tho
Would be easier if/when ggplot facets are rewritten with extensibility in mind; unofficial word from Hadley (via Twitter 2016-02-02) is that changing facets to ggproto is on his "eventually" list.
The text was updated successfully, but these errors were encountered:
As currently implemented,
mirror_ticks(p)
works by subclassingp$facet
, but meanwhile the current implementation of ggplot's+
operator handlesp + facet_*
by overwritingp$facet
entirely. This means refaceting a previously-mirrored plot will produce an unmirrored plot.Current workarounds: Adopt a style where you call
mirror_ticks
last thing before plotting, or else wrap additionalmirror_ticks
calls around any downstream facet changes:Possible more complete fixes:
Mask
+
with a version that adds mirroring back on after rewriting a facet?Subclass the facet_* functions? Major API change, but might allow a nicely gg-ish interface:
Would be easier if/when ggplot facets are rewritten with extensibility in mind; unofficial word from Hadley (via Twitter 2016-02-02) is that changing facets to ggproto is on his "eventually" list.
The text was updated successfully, but these errors were encountered: