Skip to content

Scale contraints for 2D facets #408

@teunbrand

Description

@teunbrand

Consider the following plot where x/y are free.

SELECT bill_len, bill_dep, species, island FROM ggsql:penguins
VISUALISE bill_len AS x, bill_dep AS y
DRAW point
FACET species BY island SETTING free => ['x', 'y']
LABEL
  title => 'Bill Dimensions by Species and Island',
  x => 'Bill Length (mm)',
  y => 'Bill Depth (mm)'
Image

There are a few things wrong with this plot:

  • BUG: The data-to-panel mapping is wrong.
    • Adelie penguins live on all three islands.
    • Chinstrap only on dream
    • Gentoo only on Biscoe.
  • BUG: Position scales are anchored to 0 for no apparent reason.
  • ENHANCEMENT: Position scales are free per-panel. In ggplot2, we have free scales per row/column. We should at least allow for ggplot2's behaviour of fixing x scales within a column and fixing y scales within a row to be an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    writerConcerns the writer arm of ggsql.
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions