Re: list of options in Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg61903] Re: list of options in Plot
- From: Helen Read <read at math.uvm.edu>
- Date: Fri, 4 Nov 2005 05:11:23 -0500 (EST)
- Organization: EM Computer Facility, The University of Vermont
- References: <dkcnrb$q81$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
pieter.eendebak at gmail.com wrote:
> Hi!
>
> 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]
>
> The code above does not work, I need some `unlist' function for the
> options. Can someone tell me how to do this in Mathematica?
Why not define a function do it?
p[f_, {x_,a_, b_}] := Plot[f, {x, a, b},
PlotStyle -> RGBColor[1, 0, 0], Ticks -> None]
p[x^2,{x,0,1}]
p[x^3,{x,0,1}]
p[x^2,{x,-1,1}]
p[Sin[t],{t,-2Pi,2Pi}]
And so forth.
--
Helen Read
University of Vermont