Skip to content

conflict of coord_flip() with annotation_logticks() #3954

Closed
@DSLituiev

Description

@DSLituiev

This behaves exactly like the closed issue #881, still here in ggplot2 version 3.3.0

Using a bit modified example

a <- ggplot(msleep, aes(bodywt, brainwt)) +
 geom_point(na.rm = TRUE) +
 scale_x_log10(
   breaks = scales::trans_breaks("log10", function(x) 10^x),
   labels = scales::trans_format("log10", scales::math_format(10^.x))
 ) +
 scale_y_log10(
   breaks = scales::trans_breaks("log10", function(x) 10^x),
   labels = scales::trans_format("log10", scales::math_format(10^.x))
 )

This works:

a + coord_flip()

And this works:

a + annotation_logticks()

Now,

a + coord_flip() + annotation_logticks()

returns error: Error in unit(xticks$x, "native") : 'x' and 'units' must have length > 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions