Closed Kreijstal closed 9 months ago
It's already on 0.2.0.
#cetz.canvas({
import cetz.draw: *
plot.plot(size: (8,6), {
plot.add(domain: (0, 2*calc.pi), calc.sin, label: $ sin x $)
plot.add(domain: (0, 2*calc.pi), calc.cos, label: $ cos x $)
})
})
I guess I'll have to wait till next release in https://github.com/typst/packages/
I tried this code in 2.0 unfortunately the grid is broken on the x side. Maybe this comment helps as a bug report
canvas({
import draw: *
plot.plot(
size: (8,6),
x-grid: true,
y-grid: true,
{
plot.add(domain: (0, 2*calc.pi), calc.sin, label: $ sin x $)
plot.add(domain: (0, 2*calc.pi), calc.cos, label: $ cos x $)
}
)
})
That also got fixed but not yet merged. The fix should be in the bar-/columnchart PR: #337.
Just like matplotlib! Teachers will give you negative points if your plots don't have legends.