Skip to content

Commit a2e001f

Browse files
committed
plot: Fix mark axis transformations
1 parent e6be263 commit a2e001f

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/plot.typ

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,6 @@
451451

452452
if "mark" in d and d.mark != none {
453453
draw.scope({
454-
if y.horizontal {
455-
draw.set-ctx(ctx => {
456-
ctx.transform = matrix.swap-cols(ctx.transform, 0, 1)
457-
return ctx
458-
})
459-
}
460-
461454
draw.set-style(..d.style, ..d.mark-style)
462455
mark.draw-mark(d.data, (x, y), d.mark, d.mark-size, size)
463456
})

tests/plot/marks/test.typ

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,17 @@
3232
plot.add(domain: (0, 10), samples: 11, x => x, mark: "square")
3333
})
3434
})
35+
36+
#test-case({
37+
import cetz-plot: plot
38+
plot.plot(size: (5,6), {
39+
plot.add(domain: (20, 30), x=>x, mark: "x", axes:("y", "x"))
40+
})
41+
})
42+
43+
#test-case({
44+
import cetz-plot: plot
45+
plot.plot(size: (5,6), y-horizontal: true, x-horizontal: false, {
46+
plot.add(domain: (20, 30), x=>x, mark: "x")
47+
})
48+
})

0 commit comments

Comments
 (0)