We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38693cb commit a61d45dCopy full SHA for a61d45d
tests/docs/smoke-all/jupyter/fig-format/matplotlib-svg.qmd
@@ -0,0 +1,28 @@
1
+---
2
+title: Get SVG from matplotlib
3
+format:
4
+ html:
5
+ fig-format: svg
6
+_quarto:
7
+ tests:
8
9
+ ensureHtmlElements:
10
+ - ['figure.figure img[src$=".svg"]']
11
+ - ['figure.figure img[src$=".png"]']
12
13
+
14
+```{python}
15
+import matplotlib.pyplot as plt
16
+import numpy as np
17
18
+fig, ax = plt.subplots()
19
20
+x = np.linspace(0, 4 * np.pi, 100)
21
+y1 = np.sin(x)
22
+y2 = np.cos(x)
23
24
+ax.set_title("Sine and Cosine")
25
+ax.plot(x, y1)
26
+ax.plot(x, y2)
27
+ax.legend(["Sine", "Cosine"])
28
+```
0 commit comments