Is there a way to SetOptions locally? For example, I have a Module and inside it I am doing a lot of Plots with similar options. If I do a SetOptions[Plot, ...] inside the Module, the change propagates outside. I don't like this because I have other Modules where I am doing other plots with different options.
Is there a way to do a SetOptions[Plot, ...] that only affects "local" plots (say inside a Module, but I am open to any scoping construct)? Here Plot is only an example. In general I want to set options locally for any symbol.



Internal`InheritedBlock[{Plot}, SetOptions[Plot, Frame -> True]; Plot[x, {x, 0, 1}] ]like this? – Kuba 16 hours agoOptions[Plot], do your custom stuff, and useSetOptions[]again at the end? – J. M.♦ 16 hours agoInternal`WithLocalSettings[]is also a possibility. – J. M.♦ 16 hours ago