[texhax] Drawing graphs with TikZ
Matthew Leingang
leingang at math.harvard.edu
Sun Dec 2 18:48:04 CET 2007
On Dec 2, 2007, at 5:28 AM, Tom Backer Johnsen wrote:
> Tom Backer Johnsen wrote:
>> \documentclass{article}
>> \usepackage{tikz}
>> \begin{document}
>> \begin{tikzpicture}
>> \path ( 0:2) node [shape=circle,draw] {}
>> ( 0:1) node [shape=circle,draw] {}
>> ( 0:0) node [shape=circle,draw] {}
>> ( 1,1) node [shape=rectangle,draw] {}
>> (-1,1) node [shape=rectangle,draw] {};
>>
>> \end{tikzpicture}
>> \end{document}
>>
>> This results in a figure nothing like the one in the manual, where
>> the
>> circles are all along a horizontal line (rather than vertical) with
>> the squares above and somewhat to the left of the sequence of the
>> circles. As far As I am able to see, this is an exact
>> reproduction of
>> the example.
>>
>> Can anyone point at my error?
>
> It is really strange. So often, when you do any kind of programming
> you see your error, but not before the question is out. In this case
> it is the colons in the circle that yields the unexpected results
> without any kind of message.
Dear Tom,
TikZ has a very flexible syntax for specifying coordinates; your code
didn't cause an error because it's not erroneous! The coordinate
specification (x,y) is for Cartesian coordinates, and (theta:r) is
for polar coordinates. So your coordinate (0:2) is 2 cm along the
polar line theta=0, i.e, the point with cartesian coordinates (2,0).
There is a very friendly mailing list just for pgf and tikz users:
https://lists.sourceforge.net/lists/listinfo/pgf-users
Take care and good luck.
--Matt
--
Matthew Leingang
Preceptor in Mathematics
Harvard University
http://www.math.harvard.edu/~leingang/vCard.vcf
More information about the texhax
mailing list