From cc0589f1d8d0fd1d475e9d58496410fcb9354900 Mon Sep 17 00:00:00 2001 From: Johannes Wolf Date: Sat, 7 Sep 2024 17:38:02 +0200 Subject: [PATCH] plot: Change default line mode to linear --- src/plot/line.typ | 13 ++++++------- tests/plot/legend/ref/1.png | Bin 154553 -> 154589 bytes 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plot/line.typ b/src/plot/line.typ index 12b5c6c..053ae58 100644 --- a/src/plot/line.typ +++ b/src/plot/line.typ @@ -40,7 +40,7 @@ line = (type: line) } - let line-type = line.at("type", default: "linear") + let line-type = line.at("type", default: "raw") assert(line-type in ("raw", "linear", "spline", "vh", "hv", "hvh")) // Transform data into line-data @@ -154,13 +154,12 @@ /// to the default sampling. This parameter gets passed to `sample-fn`. /// - line (string, dictionary): Line type to use. The following types are /// supported: -/// / `"linear"`: Draw linear lines between points -/// / `"spline"`: Calculate a Catmull-Rom through all points +/// / `"raw"`: Plot raw data +/// / `"linear"`: Linearize data +/// / `"spline"`: Calculate a Catmull-Rom curve through all points /// / `"vh"`: Move vertical and then horizontal /// / `"hv"`: Move horizontal and then vertical /// / `"hvh"`: Add a vertical step in the middle -/// / `"raw"`: Like linear, but without linearization taking place. This is -/// meant as a "fallback" for either bad performance or bugs. /// /// If the value is a dictionary, the type must be /// supplied via the `type` key. The following extra @@ -217,7 +216,7 @@ mark-style: (:), samples: 50, sample-at: (), - line: "linear", + line: "raw", axes: ("x", "y"), label: none, data @@ -427,7 +426,7 @@ domain: auto, samples: 50, sample-at: (), - line: "linear", + line: "raw", axes: ("x", "y"), label: none, style: (:)) = { diff --git a/tests/plot/legend/ref/1.png b/tests/plot/legend/ref/1.png index cc29e58576e06e144b7bab17d4bca5f6a616d2c0..a0d38939528d10ed99aa5477c51b3737cc587dec 100644 GIT binary patch delta 4738 zcmZ`+bwE??_usfMaw6R&B_Se=u8C7A0TBTSo#dFLg!J7&1VsT+Bosvq1YVR5M~oK` z=@1m8OQb=%e|MjQC~VVq z8RiN7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