-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I might be misunderstanding how to apply gradients to lines, but the following does not behave as I would expect.
#import "@preview/cetz:0.4.2": canvas, draw
#import "@preview/cetz-plot:0.1.3": plot
#canvas({
import draw: *
plot.plot(
size: (3,3),
axis-style: "scientific-auto",
y-tick-step: 1,
x-tick-step: 1,
{
plot.add(((0,0), (1,1)), style: (stroke: (paint: gradient.linear(black, red, black), thickness: 2pt)))
}
)
})
There is a small amount of red at the bottom corner, but that is it.
Setting relative: "parent" in the gradient works better, but does not apply to the full length of the line, with the center of the gradient being at the center of the whole plot plus axes instead of the center of the line.
Metadata
Metadata
Assignees
Labels
No labels