|
42 | 42 | "metadata": {}, |
43 | 43 | "outputs": [], |
44 | 44 | "source": [ |
45 | | - "\n", |
46 | 45 | "fig = TikzFigure()\n", |
47 | 46 | "\n", |
48 | 47 | "x = np.linspace(0, 360, 200)\n", |
|
51 | 50 | "\n", |
52 | 51 | "# First subfigure: sine wave\n", |
53 | 52 | "ax1 = fig.subfigure_axis(\n", |
54 | | - " xlabel=\"x\", ylabel=\"y\",\n", |
55 | | - " xlim=(0, 360), ylim=(-1.5, 1.5),\n", |
| 53 | + " xlabel=\"x\",\n", |
| 54 | + " ylabel=\"y\",\n", |
| 55 | + " xlim=(0, 360),\n", |
| 56 | + " ylim=(-1.5, 1.5),\n", |
56 | 57 | " grid=True,\n", |
57 | 58 | " caption=\"Sine Function\",\n", |
58 | | - " width=0.45\n", |
| 59 | + " width=0.45,\n", |
59 | 60 | ")\n", |
60 | 61 | "ax1.add_plot(x=x, y=y1, label=\"sin(x)\", color=\"red\", line_width=\"1.5pt\")\n", |
61 | 62 | "ax1.set_legend(position=\"north east\")\n", |
62 | 63 | "\n", |
63 | 64 | "# Second subfigure: cosine wave\n", |
64 | 65 | "ax2 = fig.subfigure_axis(\n", |
65 | | - " xlabel=\"x\", ylabel=\"y\",\n", |
66 | | - " xlim=(0, 360), ylim=(-1.5, 1.5),\n", |
| 66 | + " xlabel=\"x\",\n", |
| 67 | + " ylabel=\"y\",\n", |
| 68 | + " xlim=(0, 360),\n", |
| 69 | + " ylim=(-1.5, 1.5),\n", |
67 | 70 | " grid=True,\n", |
68 | 71 | " caption=\"Cosine Function\",\n", |
69 | | - " width=0.45\n", |
| 72 | + " width=0.45,\n", |
70 | 73 | ")\n", |
71 | 74 | "ax2.add_plot(x=x, y=y2, label=\"cos(x)\", color=\"blue\", line_width=\"1.5pt\")\n", |
72 | 75 | "ax2.set_legend(position=\"north east\")\n", |
|
89 | 92 | "metadata": {}, |
90 | 93 | "outputs": [], |
91 | 94 | "source": [ |
92 | | - "\n", |
93 | 95 | "canvas, (ax1, ax2) = Canvas.subplots(ncols=2, width=1000, ratio=0.3)\n", |
94 | 96 | "\n", |
95 | 97 | "x = np.linspace(0, 2 * np.pi, 200)\n", |
|
0 commit comments