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
metR's geom_vector/geom_arrow can draw arrows based either on dx and dy or magnitude and angle. If the user supplies dx and dy, then mag is a computed aesthetic. The package also has a scale_mag_continuous() with it's own guide. ggplot2 adds the relevant scale if the mag aesthetic is supplied by the user, but not if it's computed by the stat:
Maybe the best would be to provide a simple helper function, e.g. magnitude <- function(dx, dy) sqrt(dx^2 + dy^2) and remove that calculation from the stat. If you do that then the last example would become:
metR's geom_vector/geom_arrow can draw arrows based either on dx and dy or magnitude and angle. If the user supplies dx and dy, then mag is a computed aesthetic. The package also has a
scale_mag_continuous()
with it's own guide. ggplot2 adds the relevant scale if the mag aesthetic is supplied by the user, but not if it's computed by the stat:Created on 2020-12-08 by the reprex package (v0.3.0)
What should I do so that scale_mag_continuous() is added automatically even when the mag aesthetic is computed?
The text was updated successfully, but these errors were encountered: