Skip to content

All zero values with scale_y_log10() gives an error #2876

@billdenney

Description

@billdenney

When generating a figure with all zero values, scale_y_log10() gives an error instead of an empty plot. I would have hoped for a figure with all the points along the bottom (ideally as it is similar to the typical result for log scales) or otherwise an empty plot (sub-optimal since it removes some information).

library(ggplot2)
p <-
  ggplot(data.frame(x=0, y=0), aes(x=x, y=y)) +
  geom_point()
p

p + scale_y_log10()
#> Warning: Transformation introduced infinite values in continuous y-axis
#> Error in seq.default(min, max, by = by): 'from' must be a finite number

Created on 2018-09-03 by the reprex package (v0.2.0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorscales 🐍

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions