Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coord_trans() bug causes empty plot #1168

Closed
sumtxt opened this issue Jul 18, 2015 · 1 comment
Closed

coord_trans() bug causes empty plot #1168

sumtxt opened this issue Jul 18, 2015 · 1 comment

Comments

@sumtxt
Copy link

sumtxt commented Jul 18, 2015

If a variable contains zeros and the coordinate system is transformed to log space, the plot remains empty of data points and and the axis fails to render.

Example:
diamonds$price[1] <- 0
qplot(carat, price, data=diamonds) + coord_trans(x = "log10", y = "log10")

@hadley
Copy link
Member

hadley commented Jul 23, 2015

This is basically the same problem as #980 - and I can't see any easy way to fix it here. The problem is that the ranges are computed on the untransformed data, and then transformed. To avoid the problem, you'd need to transform and the compute the ranges. But that would require some really big changes, and it doesn't seem worth given the rarity of the problem.

@hadley hadley closed this as completed Jul 23, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants