oxedyne/fe2o3/fe2o3_austenite/tests/fixtures/survey/cetz_canvas.typ
897 bytes, 1 run
created by r1870400018:66907, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | #import "@preview/cetz:0.3.4": canvas, draw |
| 2 | #import "@preview/cetz-plot:0.1.1": plot, chart |
| 3 | |
| 4 | #set page(width: 14cm, height: 14cm, margin: 5mm) |
| 5 | |
| 6 | #canvas({ |
| 7 | import draw: * |
| 8 | set-style(stroke: 0.6pt) |
| 9 | circle((0, 0), radius: 1, name: "c") |
| 10 | rect((2, -1), (4, 1), name: "r", fill: luma(230)) |
| 11 | line("c.east", "r.west", mark: (end: ">")) |
| 12 | content("c", [$a$]) |
| 13 | content("r", [box]) |
| 14 | bezier((0, 1), (4, 1), (1, 3), (3, 3), stroke: blue) |
| 15 | arc((5, 0), start: 0deg, stop: 270deg, radius: 0.8, stroke: red) |
| 16 | grid((-1, -2), (5, -1), step: 0.5, stroke: gray + 0.3pt) |
| 17 | for i in range(5) { |
| 18 | line((i, -2.5), (i + 0.5, -2.2), stroke: (paint: rgb(i * 40, 80, 200), thickness: 1pt)) |
| 19 | } |
| 20 | }) |
| 21 | |
| 22 | #canvas({ |
| 23 | import draw: * |
| 24 | plot.plot(size: (6, 4), x-label: [x], y-label: [y], axis-style: "school-book", { |
| 25 | plot.add(x => calc.sin(x), domain: (0, 2 * calc.pi), label: [$sin$]) |
| 26 | plot.add(x => x * x / 10, domain: (0, 3)) |
| 27 | }) |
| 28 | }) |