Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: list of options in Plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61917] Re: list of options in Plot
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Fri, 4 Nov 2005 05:11:43 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 11/3/05 at 4:58 AM, pieter.eendebak at gmail.com wrote:

>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?

Sequence does what you want. Specifically,

options={PlotStyle->RBGColor[1,0,0], Ticks->None}
Plot[x^2, {x,0,1}, Sequence@@options]
Plot[x^3, {x,0,1}, Sequence@@options]
Plot[x^4, {x,0,1}, Sequence@@options]

Will generate the desired plots.

Another approach to this problem that shortens things even more is to do

Plot[#, {x,0,1}, PlotStyle->Red,Ticks->None]&/@{x^2, x^3, x^4};
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: list of options in Plot
  • Next by Date: Re: help on kind of 'inverse exponential' function ?
  • Previous by thread: Re: list of options in Plot
  • Next by thread: Re: list of options in Plot