MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: list of options in Plot

  • To: mathgroup at
  • Subject: [mg61931] Re: list of options in Plot
  • From: albert <awnl at>
  • Date: Sat, 5 Nov 2005 01:52:13 -0500 (EST)
  • References: <dkcnrb$q81$>
  • Sender: owner-wri-mathgroup at

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.



  • Prev by Date: Re: plotting data in a triangular domain
  • Next by Date: Re: Use of Mathematica with Rule-based Equation Derivations
  • Previous by thread: Re: list of options in Plot
  • Next by thread: Mean of skew-normal distribution