cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
733 stars 34 forks source link

style seems to not affect boxwhisker-objects #628

Closed Kuchenmampfer closed 2 weeks ago

Kuchenmampfer commented 2 weeks ago

Maybe I am dumb and don't understand the documentation, but I can not control the style of my boxwhisker-objects. I tried changing both the color of the objects and the width of box and whiskers, but nothing changed. Here is an example to reproduce this:

cetz.plot.plot(size: (12,11),
  x-tick-step: none, y-tick-step: 5,
  y-minor-tick-step: 1,
  x-min: 0, x-max: 15, x-grid: true,
  y-min: -1, y-max: 25, y-grid: "both", {
    cetz.plot.add-boxwhisker((x: 1, box-width: 0.5, style: (fill: red),
    min: 0, max: 5, q1: 3, q2: 4, q3: 4))
  }
)
johannes-wolf commented 2 weeks ago

The style parameter is an argument of add-boxwhisker, not a field of the whisker-data.

cetz.plot.plot(size: (12,11),
    x-tick-step: none, y-tick-step: 5,
    y-minor-tick-step: 1,
    x-min: 0, x-max: 15, x-grid: true,
    y-min: -1, y-max: 25, y-grid: "both", {
      cetz.plot.add-boxwhisker((x: 1, box-width: 0.5,
      min: 0, max: 5, q1: 3, q2: 4, q3: 4), style: (fill: red))
                                         /* ^-- Move this outsides the data dictionary. */ 
    }
  )

This should work.

Kuchenmampfer commented 2 weeks ago

Aaaah right. This fixes it, thank you very much for your help <3