Open haraldschilly opened 3 years ago
Changed keywords from none to plot, matplotlib, stylesheet
Description changed:
---
+++
@@ -1,11 +1,24 @@
-I'm not sure how to use the `stylesheet` option for plots. The documentation https://doc.sagemath.org/html/en/reference/plotting/sage/plot/plot.html#sage.plot.plot.plot suggests this should work, but I don't see an example. When I try `plot(sin(x^2), (x, 0, 2*pi), stylesheet="bmh")` I get a stacktrace.
+The [2D plotting documentation](https://doc.sagemath.org/html/en/reference/plotting/sage/plot/plot.html#sage.plot.plot.plot)
+suggests one can use matplotlib stylesheets,
+but provides no example.
-expected: this works and there is an example in the docs.
-
-workaround:
+This fails:
-import matplotlib.pyplot as plt -plt.style.use('bmh') -plot(sin(x^2), (x, 0, 2pi)) +sage: plot(sin(x^2), (x, 0, 2pi), stylesheet="bmh") +Traceback (most recent call last) +... +RuntimeError: Error in line(): option 'stylesheet' not valid.
+
+Expected: this works and there is an example in the docs.
+
+Workaround:
+
+```
+sage: import matplotlib.pyplot as plt
+sage: plt.style.use('bmh')
+sage: plot(sin(x^2), (x, 0, 2*pi))
+Launched png viewer for Graphics object consisting of 1 graphics primitive
+```
+
The 2D plotting documentation suggests one can use matplotlib stylesheets, but provides no example.
This fails:
Expected: this works and there is an example in the docs.
Workaround:
CC: @slel
Component: graphics
Keywords: plot, matplotlib, stylesheet
Issue created by migration from https://trac.sagemath.org/ticket/31870