f



Re: Re: Give a list of options in Mathematica 6

Attributes[Plot]

{HoldAll,Protected}

Attributes[ListPlot]

{Protected}


Bob Hanlon

---- Giacomo Ciani <jackspam79@gmail.com> wrote: 
> On 7 Gen, 13:28, Bob Hanlon <hanl...@cox.net> wrote:
> > Attributes[Plot]
> >
> > {HoldAll,Protected}
> >
> > opts = {PlotRange -> {0, 1}, AxesOrigin -> {0, 0.5}};
> >
> > Plot[x, {x, 0, 1}, Evaluate[opts]]
> >
> > Bob Hanlon
> >
> > ---- Giacomo Ciani <jackspa...@gmail.com> wrote:
> >
> > > Hi all,
> >
> > > maybe my question is stupid, but I was unable to find an answer after
> > > some hours searching in google.
> >
> > > As far as I remember, in Mathematica 5 i was able to "reuse" a list of
> > > options this way:
> >
> > > opts = {Opt1->Val1,Opt2->Val2,...}
> >
> > > Plot[f[x],{x,0,100},opts]
> > > Plot[g[x],{x,20,30},opts]
> > > Plot[h[z],{z,-10,10},opts]
> > > ...
> >
> > > Noe I'm unable to replicate this in mathematica 6. Cut and paste of a
> > > sample notebook:
> >
> > > In[65]:= opts = {PlotRange -> {0, 1}, AxesOrigin -> {0, 0.5}}
> >
> > > Out[65]= {PlotRange -> {0, 1}, AxesOrigin -> {0, 0.5}}
> >
> > > In[66]:= Plot[x, {x, 0, 1}, opts]
> >
> > > During evaluation of In[66]:= Plot::nonopt: Options expected (instead
> > > \
> > > of opts) beyond position 2 in Plot[x,{x,0,1},opts]. An option must be
> > > \
> > > a rule or a list of rules. >>
> >
> > > Out[66]= Plot[x, {x, 0, 1}, opts]
> >
> > > I thought opt WAS a list of rules, but mathematica doesn't seem to
> > > agree... :-(
> >
> > > Were I'm wrong?
> >
> > > Thanks
> >
> > > Giacomo
> 
> I all. Thank you very much, it works!
> 
> Just one more curisity: a have a notebook written by someone else with
> this two lines (among many others!)
> 
> specs = {TextStyle -> {FontSize -> 24, FontWeight -> "Bold"},
>    Frame -> True, Axes -> False, FrameStyle -> {Thickness[.005]},
>    GridLines -> {Flatten[
>       Table[kk + Log[10, jj], {kk, -16, 8}, {jj, 1, 9}]],
>      Flatten[Table[kk + Log[10, jj], {kk, -100, 100}, {jj, 1, 9}]]},
>    FrameTicks -> {Table[{kk,
>        SuperscriptBox[10, kk] // DisplayForm}, {kk, -16, 8, 1}],
>      Table[{kk, SuperscriptBox[10, kk] // DisplayForm}, {kk, -100,
>        100, 1}], None, None}};
> 
> 
> plS11t = ListPlot[
>   Transpose[{nuspt[[All, 1]], 1/2 Log[10, nuspt[[All, 2]]]}],
>   PlotJoined -> True, PlotStyle -> {Thickness[.003]}, specs,
>   DisplayFunction -> Identity]
> 
> An it works! I can't figure out what's the difference... is the
> behaviour of the ListPlot function different from that of Plot?
> 
> Thanks again
> 
> Giacomo
> 


0
hanlonr (2279)
1/9/2008 8:46:14 AM
comp.soft-sys.math.mathematica 28821 articles. 0 followers. Follow

0 Replies
564 Views

Similar Articles

[PageSpeed] 10

Reply: