ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 13 Feb 2022 12:44:24 +0100Why specifying `stylesheet` parameter in plot function causes error?https://ask.sagemath.org/question/61081/why-specifying-stylesheet-parameter-in-plot-function-causes-error/I'm disappointed by how the default plot style looks, so I decided to find some fancier stylesheet.
The [official documentation](https://doc.sagemath.org/html/en/reference/plotting/sage/plot/plot.html) says:
> MATPLOTLIB STYLE SHEET OPTION:
>
> `stylesheet` - (Default: classic) Support for loading a full matplotlib style sheet.
> Any style sheet listed in matplotlib.pyplot.style.available is acceptable.
> If a non-existing style is provided the default classic is applied.
When I try it with a simple example, I get
plot(sin, stylesheet="ggplot")
...
RuntimeError: Error in line(): option 'stylesheet' not valid.
However I found that this alternative works:
plot(sin).show(stylesheet="ggplot")
This is ugly, because I use IPython CLI and want to be able to show the plot by this syntax
p = plot(sin)
p
without typing `.show()`.
Moreover, I'd like to configure my `.sage/init.sage` file so that the 'ggplot' stylesheet is used by default:
# .sage/init.sage
plot.options["stylesheet"] = "ggplot"
This doesn't work though, for sage substitutes this option into `line()` function which appears to have no such option.
**Questions:**
1. Is this a bug, or a mistake in (my understanding of) the documentation? Should it be reported and if yes, where is the best place to do it?
2. How do I achieve custom plotting style by default (perhaps by some setting in the `init.sage` file)?
I'm using SageMath version 9.5, Release Date: 2022-01-30 with Python 3.10.2, all downloaded from ArchLinux official repos.SageUserNickSun, 13 Feb 2022 12:44:24 +0100https://ask.sagemath.org/question/61081/