Closed mikeroswell closed 1 year ago
will take a look when I get a chance ... I guess if that's the way it's done in ggplot that we should follow their lead ... ? (i.e. that suggests that abstracting/generalizing across axes will be hard ... ?)
Look to refactor using continuous_scale
c.f. https://github.com/tidyverse/ggplot2/blob/main/R/scale-.r
Might be able to get the flags and downstream functions to happen lower down in scale construction, and then call the scaling with scale_x_ratio and scale_y_ratio (which i think most people will be using most of the time anyways).
In ggplot2,
scale_x_continuous
andscale_y_continuous
are coded as duplicated functions with only the characters "x" and "y" replaced in the function name and as theaesthetics
argument toggplot2::continuous_scales()
; other named variations such asscale_x_log10()
etc. similarly copy functions verbatim for "x" and "y". Is this the best practice, and how we should proceed to define the "ratio scales" for x and y axes?https://github.com/tidyverse/ggplot2/blob/main/R/scale-continuous.r