Re: "Sticky" options when using Plot[] -- bug or feature?

*To*: mathgroup at smc.vnet.net*Subject*: [mg99485] Re: "Sticky" options when using Plot[] -- bug or feature?*From*: dh <dh at metrohm.com>*Date*: Wed, 6 May 2009 05:28:25 -0400 (EDT)*References*: <gtp1cv$ju8$1@smc.vnet.net>

Hi, SetOptions sets the options permanently (in a session). If you only want temporary settings, include it in Plot. Daniel Bob F wrote: > Any idea why the first and last "Plot[Cos[x], {x, -Pi, Pi}]" below > come out so much differently? It would appear that some of the options > are a bit "sticky" in the sense that they are not reset for the second > "Plot[Cos[x], {x, -Pi, Pi}]". Is this a bug or a feature? And make > sure that you start with a fresh kernel in case something has already > been done for the first Plot[] call ... > > Plot[Cos[x], {x, -Pi, Pi}] > > << PlotLegends` > bs = {FontFamily -> "Arial", FontSize -> 14, FontWeight -> Bold}; > SetOptions[Plot, Frame -> True, FrameStyle -> AbsoluteThickness[2], > GridLines -> Automatic, > PlotStyle -> {{Red, AbsoluteThickness[2]}, {Black, > AbsoluteThickness[2]}, {Blue, > AbsoluteThickness[2]}, {Darker@Green, AbsoluteThickness[2]}}, > BaseStyle -> bs]; > Plot[{Sin[x], Cos[x], Tan[x]}, {x, 0, 1}, > PlotStyle -> {Directive[Blue, Thick], > Directive[Thick, Red, DotDashed], Directive[Thick, Green, Dotted]}, > Background -> LightOrange, > PlotLegend -> {"sin x", "cos x", "tan x"}, > LegendPosition -> {-.6, 0.1}, LegendOrientation -> Vertical, > LegendBackground -> LightPurple, LegendShadow -> {.02, -.02}, > LegendSize -> {0.3, 0.35}, FrameLabel -> {"x", "trig functions"}] > > Plot[Cos[x], {x, -Pi, Pi}] > > Please let me know if you find the same problem. I tried this on a Mac > OS X 10.5.6 system with version 7.0.1 of Mathematica. Thanks... > > -Bob >