infotroph / ggplotTicks

Copy axes from bottom to top and left to right sides of a ggplot.
Other
9 stars 1 forks source link

Fails if one axis has no ticks #5

Open infotroph opened 8 years ago

infotroph commented 8 years ago

See the README for one example where the lack of ticks is at least expected. A case where this might arise with less warning:

p = ggplot(mtcars, aes(wt, mpg)) + geom_point() + scale_x_log10()
p 
# Huh, no ticks assigned to the x-axis.
# This is arguably a  bug in somewhere in `scale`, but plot looks OK otherwise

mirror_ticks(p)
# Error in match_axes(cur_panel, axis_extents) : Can't match axes to panel

Possible fixes: