grantmcdermott / grantmcdermott/tinyplot

`asp` not respected when `facet.args = list(free = TRUE)`

Open
#555 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
427
Forks
25
Avg merge
22h 54m
Merged PRs (30d)
28

Description

MRE

This creates a 1x1 square with a length 10 line segment protruding to the right. asp=1 should make the square look like a square, not a rectangle. "A", "B", and "C" have identical data.

png(width = 600, height = 200, unit = "px")
tinyplot(
  y ~ x,
  facet = ~group,
  facet.args = list(free = TRUE),
  data = data.frame(
    y = rep(c(1, 1, 2, 2, 1, 1.5, 1.5), 3),
    x = rep(c(2, 1, 1, 2, 2, 2, 11), 3),
    group = c(rep("A", 7), rep("B", 7), rep("C", 7))
  ),
  type = "l",
  asp = 1
)
dev.off()
Expected behavior

Since the data is identical for each group, facet.args = list(free = TRUE) should have no impact. Different plots should be free show different ranges, but asp=1 should be preserved within each plot.

Image
Actual behavior
Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the issue's R MRE through the tinyplot() entry point and compare the faceted output with and without facet.args = list(free = TRUE). Trace how asp is handled for free facets; done means identical groups retain the requested aspect ratio while distinct ranges can remain free.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.