Re: Re: Give a list of options in Mathematica 6
- To: mathgroup at smc.vnet.net
- Subject: [mg84650] Re: [mg84635] Re: Give a list of options in Mathematica 6
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Tue, 8 Jan 2008 01:31:17 -0500 (EST)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <flslng$ps9$1@smc.vnet.net> <200801071132.GAA04504@smc.vnet.net>
- Reply-to: murray at math.umass.edu
Please ignore my response to each of two responders to the following query. In each I said the proposed solution using Evaluate[opts] or Epilog->opts) didn't work for me. They do, in fact work; somehow I made a copy-and-paste error in going from the e-mail to the front end input cell. Nasser Abbasi wrote: > "Giacomo Ciani" <jackspam79 at gmail.com> wrote in message > news:flslng$ps9$1 at smc.vnet.net... >> 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 >> > > Plots needs Evaluate: > > > opts = {PlotRange -> {0, 1}, AxesOrigin -> {0, 0.5}}; > Plot[x, {x, 0, 1}, Evaluate[opts]] > > Nasser > > > > -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
- References:
- Re: Give a list of options in Mathematica 6
- From: "Nasser Abbasi" <nma@12000.org>
- Re: Give a list of options in Mathematica 6