When x values contain 0, using coord_trans("sqrt") removes the axis line
Open
Nobody has claimed this yet.
bug
coord :world_map:
- Dominant language
- R
- Stars
- 7k
- Forks
- 2.1k
- Avg merge
- 59m
- Merged PRs (30d)
- 2
Description
ggplot(iris,aes(Petal.Length,Sepal.Width))+
geom_point()+
coord_trans(x="sqrt")+
theme(axis.line.x = element_line(color="black"))
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"))
I believe the axis line should stay preserved, since sqrt(0)=0, or is there a conceptual error in my reasoning?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the two ggplot examples from the issue and compare the x-axis rendering when Petal.Length contains no zero versus a zero. Trace the coord_trans("sqrt") handling and axis-line rendering; done means the x-axis line remains visible when sqrt(0)=0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100