グラフしたい(simple-plot)
1#import "@preview/simple-plot:0.2.0": plot
2
3#align(center)[
4#plot(
5 xmin: -1.2,
6 xmax: 1.2,
7 ymin: -1.2,
8 ymax: 1.2,
9 width: 10,
10 height: 10,
11 axis-x-pos: 0,
12 axis-y-pos: 0,
13 show-grid: true,
14
15 // 上半円
16 (
17 fn: x => calc.sqrt(1 - x*x),
18 domain: (-1, 1),
19 stroke: blue + 1.5pt,
20 ),
21
22 // 下半円
23 (
24 fn: x => -calc.sqrt(1 - x*x),
25 domain: (-1, 1),
26 stroke: blue + 1.5pt,
27 ),
28)
29]
simple-plotで、簡単なグラフを描画できます。
本文中の数式をグラフにしたい場合などに利用できます。
注釈
simpleplot(ハイフンなし)という同じような名前のパッケージもあるようなので注意してください。