Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Global Variables in Options?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80674] Re: Global Variables in Options?
  • From: Vince Virgilio <blueschi at gmail.com>
  • Date: Tue, 28 Aug 2007 06:40:00 -0400 (EDT)
  • References: <far97o$41j$1@smc.vnet.net>

On Aug 26, 3:14 am, AES <sieg... at stanford.edu> wrote:
> Can Options contain global variables?  (in 5.2)
>
> For example, can I do
>
>       SetOptions[Plot, TextStyle->{FontSize->myFontSize}];
>
>       (* with no numerical value yet assigned to myFontSize *)
>
> and then later on in the notebook write
>
>       myFontSize = 14; Plot[ <<first plot>> ];
>
>       myFontSize = 16; Plot[ <<second plot>> ];
>
> Or must I structure this as
>
>       myFontSize = 14;
>       SetOptions[Plot, TextStyle->{FontSize->myFontSize}];
>       Plot[ <<first plot>> ];
>
>       myFontSize = 16;
>       SetOptions[Plot, TextStyle->{FontSize->myFontSize}];
>       Plot[ <<second plot>> ];

I think options can contain global variables. To verify, use a delayed
rule ":>", instead of "->" for TextStyle in the first SetOptions
above.

Vince Virgilio



  • Prev by Date: Re: version 6 Plot3D exporting results in HUGE files
  • Next by Date: Re: Mistake in applying a rule
  • Previous by thread: Re: Global Variables in Options?
  • Next by thread: Manipulate menu items from FrontEnd?