MathGroup Archive 2007

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

Search the Archive

Re: Making sense of Directive[ ]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg75865] Re: Making sense of Directive[ ]
  • From: Albert <awnl at arcor.net>
  • Date: Sat, 12 May 2007 03:07:02 -0400 (EDT)
  • References: <f1uohq$876$1@smc.vnet.net>

Forex Ample wrote:
> I stumbled upon the new Directive[ ] function, used to group Graphics 
> directives into one compound directive. However, I fail to see what it is 
> good for. In every example in the documentation, replacing Directive with 
> List seems to produce the exact same results. Anybody got a clue?

Not that I have a clue, but it is easy to make up examples, where there 
_is_ a difference:

Graphics[{{Red, Thick}, Line[{{0, 0}, {1, 1}}]}]

Graphics[{Directive[Red, Thick], Line[{{0, 0}, {1, 1}}]}]

the first line will not be red and thick, the second is. This makes 
something like the following easier:

mystyle = Directive[Red, Thick];

Graphics[{mystyle, Line[{{0, 0}, {1, 1}}]}]

where without Directive you would need:

mystylelist = {Red, Thick};

Graphics[{Sequence @@ mystylelist, Line[{{0, 0}, {1, 1}}]}]

anyway, I can hardly believe that this alone is enough to justify the 
introduction of Directive :-)


albert


  • Prev by Date: Re: axes labeling
  • Next by Date: Re: Can one retain ver 5.1 if downloading ver 6.0?
  • Previous by thread: Re: Making sense of Directive[ ]
  • Next by thread: Re: Re: Making sense of Directive[ ]