Re: "Sticky" options when using Plot[] -- bug or feature?
- To: mathgroup at smc.vnet.net
- Subject: [mg99454] Re: "Sticky" options when using Plot[] -- bug or feature?
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 6 May 2009 05:22:38 -0400 (EDT)
- Organization: Uni Leipzig
- References: <gtp1cv$ju8$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, if you set the Options[] with SetOptions[], than the options are changed permanently. If you wish to change it only for a single call you must set the options in the call of the function. Regards Jens 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 >