cetz-package / cetz-plot

Create Plots and Charts with CeTZ
GNU Lesser General Public License v3.0
23 stars 1 forks source link

Default `plot.add(line: "raw")` instead of `"linear"` #22

Open JamesxX opened 1 month ago

JamesxX commented 1 month ago

https://github.com/cetz-package/cetz-plot/blob/8a5f0658b4dea5a889f7ce096e38b6f38bd81b22/src/plot/line.typ#L220

I think people will naturally expect the function being plotted to have its points filtered if its linear (been chasing my tail because of this because of logarithmic plots of linear functions)

johannes-wolf commented 1 month ago

Is there a visible difference if you change it to "raw"? The reason of "linear" is to have fewer points if lines are straight, which can improve rendering speed of PDF & SVGs a lot! There must be no visible difference between the two modes. Maybe the options name is bad.

JamesxX commented 1 month ago

linear: image

image

johannes-wolf commented 1 month ago

The error here is, that the linearization/optimization is done on the source data, which is not good. Goal: optimize the generated line-segments.