Skip to content

Inconsistency geom_abline <-> geom_hline for log10 transformation #3741

Closed
@lcougnaud

Description

@lcougnaud

In case a transformation is applied, the geom_hline function takes the intercept in the initial scale, contrary to the other geoms.

p1 <- ggplot(mpg, aes(displ, hwy)) + geom_point() + scale_y_log10()

The line is created if the intercept is specified in the original (non-transformed) scale in geom_hline:

p1 + geom_hline(yintercept = 30)

ggplot_hline_intercept-raw

Contrary to the geom_abline behaviour:

p1 + geom_abline(intercept = log10(30), slope = 0)

ggplot_abline_intercept-log10

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