I’m trying to figure our how to draw a simple function (say y=x^2) in cetz.
Ideally I’d like to be able to draw Desmos like functions directly into my documents.
I can draw a trig graph but will get error messages every time I try to convert to something else e.g 1/x, x^2 etc.
Here’s the code of the trig graph that I’ve got working so far, but how can I transform the sine graph to a parabola?
#import “@preview/cetz:0.3.2”
#import “@preview/cetz-plot:0.1.1”
cetz.canvas(
{
import cetz.draw: *
import cetz-plot: *
plot.plot(size: (5,5), x-tick-step: none, y-tick-step: none,
plot.add(
domain: (0,2*calc.pi),
(calc.sin)
)
)
}
)