Re: RuleDelayed plot options and Show

*To*: mathgroup at smc.vnet.net*Subject*: [mg77802] Re: [mg77781] RuleDelayed plot options and Show*From*: DrMajorBob <drmajorbob at bigfoot.com>*Date*: Sun, 17 Jun 2007 06:03:52 -0400 (EDT)*References*: <23637841.1181983021122.JavaMail.root@m35>*Reply-to*: drmajorbob at bigfoot.com

The index in your AxesLabel has to be global, since it can't be a local variable peculiar to Table, which after all (I think) has a different internal name each time the Table is executed. SetOptions[Plot, AxesLabel :> {"X", y[[k]]}]; y = {"Y1", "Y2"}; Show[GraphicsArray[Table[k = i; Plot[Sin[x], {x, -1, 1}], {i, 2}]]] Bobby On Sat, 16 Jun 2007 03:00:24 -0500, zac <replicatorzed at gmail.com> wrote: > Dear Group, > > evaluate code to see error message: > > SetOptions[Plot, AxesLabel :> {"X", y[[i]]}]; > > y = {"Y1", "Y2"}; > > Show[ > GraphicsArray[ > Table[ > Plot[Sin[x], {x, -1, 1}] > , {i, 2}] > ] > ]; > > The problem is Show does not know what iterator 'i' means. The > individual plots have the correct y axis labels, but Show failes to > print them in the array (since in Show the y labels are re-evaluated - > due to RuleDelayed). > The layout of this code I do not want to change (ie. the SetOptions as > initialization, and the delayed rule for the y label). > Any suggestion? > > thanks in forward > Istvan Zachar > > > -- DrMajorBob at bigfoot.com