8000 Custom breaks with facetted_pos_scales returns error · Issue #91 · teunbrand/ggh4x · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Custom breaks with facetted_pos_scales returns error #91
Closed
@EcologyTom

Description

@EcologyTom

Hi,

Many thanks for ggh4x, it's great. I want to create custom breaks in a 40 panel plot I've created with facet_grid2. Each panel needs custom x breaks. Following an answer on SO I created a list with my custom breaks like so:

CUSTOM.BREAKS <- list(
  scale_x_continuous(breaks = c(40, 80, 120, 160)),
  scale_x_continuous(breaks = c(50, 100, 150, 200, 250)),
  scale_x_continuous(breaks = c(40, 80, 120, 160)),
  scale_x_continuous(breaks = c(50, 100, 150, 200, 250)),
  scale_x_continuous(breaks = c(0, 10, 20, 30)),
  scale_x_continuous(breaks = c(0, 10, 20, 30)),
etc, one custom scale per panel

And refer to the list in the ggplot call:
+ facetted_pos_scales(y = CUSTOM.BREAKS)
but this returns:

Error in facetted_pos_scales(y = CUSTOM.BREAKS) : 
  Invalid facetted scale specifications.

I must be referring to the panels incorrectly. I'm unclear how I could refer to the individual panels directly in facetted_pos_scales, the help file refers to only rows or columns. Please could you give some direction on how to set the breaks for each the indivudal panel? Many thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0