The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: options in Plot
Replies: 1   Last Post: Dec 20, 2012 3:19 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
David Park

Posts: 1,560
Registered: 5/19/07
Re: options in Plot
Posted: Dec 20, 2012 3:19 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

It's because of the respective Attributes of ListPlot and Plot.

{Protected, ReadProtected}
{HoldAll, Protected, ReadProtected}

So you have to Evaluate the opts in Plot.

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

Maybe somebody can again explain why Plot has the Attribute HoldAll, instead
of no Holds or HoldFirst.

I still think it would be helpful if the Function pages had a distinctive
place that listed all Attributes of a function. They tend to get lost in
the Details listing and do not list all of them. It may be that all WRI
functions are Protected, but not all private symbols are.

David Park

From: Nigel King []

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?


Nigel King

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.