Skip to content

Secondary axis doesn't work with coord_polar #2072

Closed

Description

@Henrik-P

When adding a secondary axis (dup_axis / sec_axis) to a plot with polar coordinates (coord_polar), the labels and the tick marks doesn't show up. The name appears though.

ggplot(mtcars, aes(x = factor(cyl))) +
  geom_bar() +
  coord_polar() +
  scale_y_continuous(sec.axis = dup_axis())

ggplot(mtcars, aes(x = factor(cyl))) +
  geom_bar() +
  coord_polar() +
  scale_y_continuous(sec.axis = sec_axis(~. * 0.1, name = "sec count"))

See also this post on SO.

Activity

  1. thomasp85 commented on Mar 11, 2017

    @thomasp85
    Member

    Can you try this with the development version? It is potentially fixed

  2. Henrik-P commented on Mar 11, 2017

    @Henrik-P
    Author

    I tried with ggplot2_2.2.1.9000, but it didn't work.

  3. thomasp85 commented on Mar 11, 2017

    @thomasp85
    Member

    Ok - then please provide a reproducible example

  4. Henrik-P commented on Mar 11, 2017

    @Henrik-P
    Author

    Sorry if I was unclear - in my original post I used the current CRAN version (2.2.1). I then followed your suggestion and tried the current development version 2.2.1.9000 on the same (reproducible) code, with the same result as in my first attempt.

    R version 3.3.3, Platform: i386-w64-mingw32/i386 (32-bit).

  5. thomasp85 commented on Mar 11, 2017

    @thomasp85
    Member

    I'm really just too tired and mixed the conversations. Your example is fine thanks

  6. added
    bug
    on Jun 12, 2017
  7. locked as resolved and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions