Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating default() in Plots does not update the plots #1095

Closed
lmiq opened this issue Apr 14, 2021 · 1 comment
Closed

updating default() in Plots does not update the plots #1095

lmiq opened this issue Apr 14, 2021 · 1 comment

Comments

@lmiq
Copy link

lmiq commented Apr 14, 2021

If one sets a cell with, for example:

default(framestyle=:box,label="",linewidth=2)

and have some plot afterwards, updating the linewidth, for example, does not update automatically the plot styles.

Minimal set of cells:

using Plots
default(framestyle=:box,label="",linewidth=2)
plot(rand(10),rand(10))
@fonsp
Copy link
Owner

fonsp commented Apr 15, 2021

That's because it is a sateful mutation, hidden from Pluto, see #564 #316. You might want to file an issue with Plots.jl to change their API into something without this state problem, but I doubt that it's possible without changing the API drastically.

I would suggest something like:

plot = Plots.generate_plot_method(framestyle=:box,label="",linewidth=2)

Then you make the dependency explicit, and you can have multiple plot styles in parallel:

plot = Plots.generate_plot_method(framestyle=:box,label="",linewidth=2)
thickplot = Plots.generate_plot_method(framestyle=:box,label="",linewidth=10)

@fonsp fonsp closed this as completed Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants