Skip to content

Plot marks do not respect axis bounds #76

@jamesrswift

Description

@jamesrswift

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    👿 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions