Skip to content

When x values contain 0, using coord_trans("sqrt") removes the axis line #5919

Open
@kdarras

Description

@kdarras
ggplot(iris,aes(Petal.Length,Sepal.Width))+
  geom_point()+
  coord_trans(x="sqrt")+
  theme(axis.line.x = element_line(color="black"))

image

iris$Petal.Length[1]=0
ggplot(iris,aes(Petal.Length,Sepal.Width))+
  geom_point()+
  coord_trans(x="sqrt")+
  theme(axis.line.x = element_line(color="black"))

image

I believe the axis line should stay preserved, since sqrt(0)=0, or is there a conceptual error in my reasoning?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorcoord 🗺️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions