cetz-plot icon indicating copy to clipboard operation
cetz-plot copied to clipboard

Plot marks do not respect axis bounds

Open jamesrswift opened this issue 1 year ago • 0 comments

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

jamesrswift avatar Oct 31 '24 20:10 jamesrswift