Drawing is not centered

View: New views
2 Messages — Rating Filter:   Alert me  

Drawing is not centered

by Daniel Dilts-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I just started using TikZ last night, and I love it.

I am creating a diagram for class and I am having troubles with two  
things.

1. The drawing isn't centered on the page.  I have the drawing wrapped  
in a figure section and the caption for the figure is centered, but  
the drawing is not.

\begin{figure}[h]
   \begin{tikzpicture}[scale=.2]
   %outer circle
   \draw (0,0) circle (18cm);
   \end{tikzpicture}
   \caption{Forces on Rotating Disk}
\end{figure}

2. I can't get a label to locate at the center of an arc.  The  
examples in the manual show how to place a label at the center of a  
line but I can't figure out how to get it at the center of an arc.  
Currently I have

\begin{figure}[h]
   \begin{tikzpicture}[scale=.2]
   %Theta line
   \draw[->] (0,18.5cm) -- (0,20cm) arc (90:45:20cm) node[above=1em]{$
\Theta$};
   \end{tikzpicture}
   \caption{Forces on Rotating Disk}
\end{figure}

I have tried \draw[->] (0,18.5cm) -- (0,20cm) arc node{$\Theta$}  
(90:45:20cm); but that seems to lock up or crash.

Does anyone have any ideas what I am missing?

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Drawing is not centered

by GGBBRR :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For your first problem you could explicitly specify that you want the tikzpicture centred, like this:

\begin{figure}[h]
\begin{center}
   \begin{tikzpicture}[scale=.2]
   %outer circle
   \draw (0,0) circle (18cm);
   \end{tikzpicture}
\end{center}
   \caption{Forces on Rotating Disk}
\end{figure}

For your second problem. Theta is drawn above the endpoint of the arc.
You could specify a path to the middle of the arc and put theta above the endpoint of that path, like this:

\begin{figure}[h]
\begin{center}
   \begin{tikzpicture}[scale=.2]
   \draw[->] (0,18.5cm) -- (0,20cm) arc (90:45:20cm);
   \path (0,20cm) arc (90:67.5:20cm)  node[above=0.1em]{$\Theta$};
   \end{tikzpicture}
\end{center}
   \caption{Forces on Rotating Disk}
\end{figure}

Regards,
Gerben