Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: A Question About Directive

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111281] Re: A Question About Directive
  • From: Mark McClure <mcmcclur at unca.edu>
  • Date: Mon, 26 Jul 2010 06:37:14 -0400 (EDT)

On Fri, Jul 23, 2010 at 7:09 AM, Kevin J. McCann <Kevin.McCann at umbc.edu> wrote:
> I'll agree that your example with the use of the Inner product is a clever
> way to do that, but isn't this way more readable?
>
> Graphics[{
> Red,PointSize[Large],Point[{0,0}],
> Blue,PointSize[Medium],Point[{1,0}]
> },
> AspectRatio->1/10]

Certainly, I'm not suggesting that one should use Inner and Directive
to place a couple of differently colored and sized dots in a picture!
I do a fair amount of graphics programming and, in that context, it
can be convenient to have a head that indicates Graphics directives.
Here's another example:

DeleteCases[Graphics[
 {Directive[Red], Point[{0, 0}]}],
 _Directive, Infinity]

This is a long winded way to create a single black dot.  While not the
most efficient way to do it, this code indicates the kind of thing
that one might do if one always enclosed directives in the Directive
head.

Mark


  • Prev by Date: Re: de-nesting complex nested lists
  • Next by Date: Re: All pairs shortest paths
  • Previous by thread: Re: A Question About Directive
  • Next by thread: Re: A Question About Directive