Re: list of options in Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg61931] Re: list of options in Plot
- From: albert <awnl at arcor.de>
- Date: Sat, 5 Nov 2005 01:52:13 -0500 (EST)
- References: <dkcnrb$q81$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Pieter, > I need to plot functions with the same options all over again. For > example > > Plot[ x^2, {x,0,1}, PlotStyle->RBGColor[1,0,0], Ticks->None] > Plot[ x^3, {x,0,1}, PlotStyle->RBGColor[1,0,0], Ticks->None] > Plot[ x^4, {x,0,1}, PlotStyle->RBGColor[1,0,0], Ticks->None] > > I would like to shorten this to > > options={PlotStyle->RBGColor[1,0,0], Ticks->None} > Plot[x^2, {x,0,1}, options] > Plot[x^3, {x,0,1}, options] > Plot[x^4, {x,0,1}, options] > As usual there are many ways to achieve what you want and I have seen that others have sent useful suggestions. Anyway I could not resist to present the following, just because it looks like the whole Options mechanism is there to do exactly what you want: SetOptions[Plot, PlotStyle -> RGBColor[1, 0, 0], Ticks -> None] Plot[x^2, {x, 0, 1}] Plot[x^3, {x, 0, 1}] Plot[x^4, {x, 0, 1}] of course you might want to reset the options to their defaults, depending on what follows. There is also a package in MathSource (BlockOptions) that lets you temporarily SetOptions of symbols and does the cleanup automatically, but I have never used it. hth albert