Skip to content
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

Plot marks do not respect axis bounds #76

Open
jamesrswift opened this issue Oct 31, 2024 · 0 comments
Open

Plot marks do not respect axis bounds #76

jamesrswift opened this issue Oct 31, 2024 · 0 comments
Labels
👿 bug Something isn't working

Comments

@jamesrswift
Copy link
Collaborator

Expected behaviour: Marks are drawn only for those points which are shown.

Observed: Marks are drawn even for those points which are outside of the axis min-max.

MRE:

#import "@preview/cetz:0.3.1"
#import "@preview/cetz-plot:0.1.0"

#set page(width: auto, height: auto)

#cetz.canvas({
  cetz-plot.plot.plot(
    size: (5,5),
    x-min: 1, x-max: 2,
    {
      cetz-plot.plot.add(
        domain: (0, 3),
        mark: "x",
        x=>x,
      )
    }
  )
})

image

I think the problem might be from here:

https://github.com/cetz-package/cetz-plot/blob/master/src/plot/mark.typ#L37-L45

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

Successfully merging a pull request may close this issue.

2 participants