MathGroup Archive 2006

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

Search the Archive

Re: On order of options to Graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70281] Re: On order of options to Graphics
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Wed, 11 Oct 2006 01:53:47 -0400 (EDT)

On 10/10/06 at 6:11 AM, nma at 12000.org (Nasser Abbasi) wrote:

>5.2 on XP:

>It seems strange to me that the order of arguments in this example
>should have made a difference, but it does:

>When I write Thickness[] After Line[] it has no effect. But before,
>it does:

>Show[  Graphics[    {  Line[{{1, 0}, {1, 6}}],   Thickness[0.1] 
>}  ]  ] (*does not work eq(1)*)

>Show[  Graphics[    {  Thickness[0.1],  Line[{{1, 0}, {1, 6}}]  
>}  ]  ] (*now it works  eq(2)*)

I don't understand why you think this strange. Wouldn't you 
expect Mathematica to execute directives in the order in which 
they appear?

In you first example, you ask Mathematica to draw a line (using 
the default settings since no other directives have been given 
previously then ask Mathematica to set the thickness to a 
specific value. Of course since the line as already been drawn 
and there no additional drawing actions for Mathematica to do, 
the Thickness[0.1] directive has no effect on the resulting graphic.

In the second example, you ask Mathematica to set the thickness 
to a specific value then draw a line. So, of course the line is 
drawn with the thickness you asked for.

>From help it says:

>Graphics[ primitives, options]

Right. Options normally are expressed as rules, i.e., have the 
form option->value. Thickness[0.1] is not an option.

<snip>

>It seems more logical to me to write {Primitive,Directive}.

This seems totally illogical to me. This is asking Mathematica 
to draw a primitive before the directives on how to draw that 
primitive are given. Why would you expect this to work? Clearly, 
all Mathematica can do is draw the primitive with default directives.
--
To reply via email subtract one hundred and four


  • Prev by Date: Automate datafitting to a series of parameterized function
  • Next by Date: Re: Troubles with Integrate
  • Previous by thread: Re: Automate datafitting to a series of parameterized function
  • Next by thread: Re: On order of options to Graphics