Skip to content

Plot with inset, axis marks and two bands has wrong auto height #2327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mootari opened this issue May 28, 2025 · 2 comments
Open

Plot with inset, axis marks and two bands has wrong auto height #2327

mootari opened this issue May 28, 2025 · 2 comments
Assignees
Labels
bug Something isn’t working

Comments

@mootari
Copy link
Member

mootari commented May 28, 2025

If a plot specifies an inset as well as axis marks, then the resulting height causes y labels to overlap if the data only produces two bands:

Plot.plot({
  inset: 20,
  marks: [
    Plot.axisX({anchor: "top"}),
    Plot.axisX({anchor: "bottom"}),
    Plot.dot("AB", {y: d => d, x: 0})
  ]
})

Screenshot:

Image
@mootari mootari added the bug Something isn’t working label May 28, 2025
@mbostock
Copy link
Member

I don’t think the auto height accounts for insets. Not sure if we can do that, so this might be intended behavior.

@mootari
Copy link
Member Author

mootari commented May 28, 2025

@mbostock Should I turn the issue into a feature request to consider insets when calculating the height?

@Fil Fil self-assigned this Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

No branches or pull requests

3 participants