MathGroup Archive 2003

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

Search the Archive

Re: Re: RE: Options in ListPlot and Plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38667] Re: [mg38643] Re: [mg38624] RE: [mg38613] Options in ListPlot and Plot
  • From: Jan Mangaldan <hokenjan at yahoo.com>
  • Date: Sat, 4 Jan 2003 07:25:52 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Sorry. I had a typo in the snippet I gave. It should have been
In[1]:= pts=Table[Sin[u], {u,0,2 Pi, Pi/30}]; 
In[2]:= ListPlot[pts]; 
                                                                                                        Jan M. (^_^)
 Jan Mangaldan <hokenjan at yahoo.com> wrote:Well, for one thing, if ListPlot had the HoldAll attribute, the following wouldn't work: 
In[1]:= pts=Table[Sin[u], {u,0,2 Pi, Pi/0}]; 
In[2]:= ListPlot[pts]; 
You'd have to wrap Evaluate[] around pts if you don't want to get a bunch of error messages . 
If you want first-hand experience of how it would be if ListPlot had the HoldAll attribute, execute this: 
In[3]:= Unprotect[ListPlot]; SetAttributes[ListPlot, HoldAll]; Protect[ListPlot]; 
and try to execute the commands I gave previously. 
Jan M. (^_^) 
David Park wrote: Mike,

Attributes[ListPlot]
{Protected}

Attributes[Plot]
{HoldAll, Protected}

I do not know why Mathematica is inconsistent here.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/



From: Mike [mailto:mikeh1980 at optusnet.com.au]
To: mathgroup at smc.vnet.net


For appearance reasons I usually place all my Plot and ListPlot options in a
list eg.

optionA={PlotStyle->{....},Frame->True, and so on}

When I plot a list everything is fine:

ListPlot[list, optionA]

out=> nice plot

but when I use options in Plot I get an error message unless I wrap Evaluate
around the options.

For example

Plot[x^2,{x,0,5}, optionB]

out=> messages

Plot[x^2,{x,0,5}, Evaluate[optionB]]

out=> nice plot


??? why is this so????

Why must I wrap Evaluate around my options in Plot?

thanks

Mike

ps. This is with version 4.0.2 on a G4 power Mac.





  • Prev by Date: Call for Papers: The Mathematica Journal Special Issue on Statistics
  • Next by Date: Re: Solving Alphametics with Mathematica
  • Previous by thread: Re: RE: Options in ListPlot and Plot
  • Next by thread: Re: Table Lookup Function?