For Programmers: Free Programming Magazines  


Home > Archive > Mathematica > October 2006 > Re: On order of options to Graphics









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: On order of options to Graphics
dh

2006-10-20, 4:18 am



Hi Nasser,

Thickness changes all the drawings that are specified afterwards. By

this you may have different linewidth in your graphics. E.g.:

Show[Graphics[{Thickness[0.1], Line[{{0, 0}, {1, 0}}], Thickness[0.05],

Line[{{1, 0}, {1, 1}}], Thickness[0.01], Line[{{1, 1}, {0, 1}}]}]]

Daniel



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)*)


>


> From help it says:


>


> Graphics[ primitives, options]


>


> Then It gives Line[] as an example of a graphic primitive, and Thickness[]


> as an example of graphics Directive. But help did NOT say which order the


> primitive and directive should have with respect to each others. It just


> says "the following directives can be used" and leaves it up to the user to


> figure that the order of primitive and directive is important.


>


> So based on this little experiment, One must write


>


> Graphics[ { Directive, Primitive } ] ----> maps to eq (2) which


> works


>


> and not


>


> Graphics[ { Primitive, Directive } ] ----> maps to eq(1)


>


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


> not work. One must have the Directive before the Primitive.


>


> I wish the help can be more detailed. I find Mathematica help hard to follow


> many times. Mathematica help needs to be more detailed.


>


> Nasser


>


>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com