Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: options in Plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129186] Re: options in Plot
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Thu, 20 Dec 2012 03:22:01 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20121219095554.22A31695A@smc.vnet.net>

{#, Attributes[#]} & /@ {Plot, ListPlot}

{{Plot, {HoldAll, Protected, ReadProtected}}, {ListPlot, {Protected,
   ReadProtected}}}

Plot has the attribute HoldAll. As always you need to use Evaluate to
override the HoldAll.

opts = {Frame -> True, GridLines -> {{1}, {1}}};

Plot[x, {x, 0, 1}, Evaluate[opts]]


Bob Hanlon


On Wed, Dec 19, 2012 at 4:55 AM, Nigel King
<nigel.king at cambiumnetworks.com> wrote:
>
> Hi MathGroup,
> Most Graphic functions allow applying a collection of options as in
> opts = {Frame -> True, GridLines -> {{1}, {1}}}
>
> One can then use the opts in the following plots
> ListPlot[{{1, 1}}, opts]
> Plot[x, {x, 0, 1}, opts]
> The ListPlot works as expected, the Plot does not. It results with
> Plot[x, {x, 0, 1}, opts]
>
> I believe that this is a change from M8 to M9.
>
> Is this a bug or intended functionality?
>
> Thanks
>
> Nigel King
>
>



  • References:
  • Prev by Date: vertical line tied to slider
  • Next by Date: Using a notebook as a notebook.
  • Previous by thread: options in Plot
  • Next by thread: Re: options in Plot