Skip to content

Consolidate definition of position aesthetics #3342

Closed
@paleolimbot

Description

@paleolimbot

In attempting to refactor the guide code to work with position guides, I found 8 definitions of what is a position aesthetic, only one of which is used by is_position_aes().

ggplot2/R/aes.r

Lines 176 to 177 in 1f6f0cb

var[var %in% c("x", "xmin", "xmax", "xend", "xintercept")] <- "x"
var[var %in% c("y", "ymin", "ymax", "yend", "yintercept")] <- "y"

c("x", "xmin", "xmax", "xend", "xintercept", "xmin_final", "xmax_final", "xlower", "xmiddle", "xupper", "x0"),

c("y", "ymin", "ymax", "yend", "yintercept", "ymin_final", "ymax_final", "lower", "middle", "upper", "y0"),

sc <- discrete_scale(c("y", "ymin", "ymax", "yend"), "position_d", identity, ...,

sc <- discrete_scale(c("x", "xmin", "xmax", "xend"), "position_d", identity, ...,

ggplot2/R/annotation.r

Lines 42 to 43 in 1f6f0cb

x = x, xmin = xmin, xmax = xmax, xend = xend,
y = y, ymin = ymin, ymax = ymax, yend = yend

c("x", "xmin", "xmax", "xend"),

c("y", "ymin", "ymax", "yend"),

if (all(aesthetics %in% c("x", "xmin", "xmax", "xend", "y", "ymin", "ymax", "yend"))) {

Is there a reason that any of these definitions should be different from the one in scale_(x|y)_continuous()?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions