Skip to content

sec_axis changes with environmental variable #3143

@abl0719

Description

@abl0719

When there are variables in the transformation function in sec_axis, the plot changes after the variable changes.

##### ggplot bug #####
library(ggplot2)
temp_data <- data.frame(x=1:4, y=1:4)
temp_scale <- 1
a <- ggplot() + geom_point(data = temp_data, aes(x=x, y=y)) +
  scale_y_continuous(sec.axis = sec_axis(~.*temp_scale))
a

temp_scale <- 4
a

Created on 2019-02-14 by the reprex package (v0.2.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions