View Full Version : Drawing using Latex
Hello,
How can I draw the following figure using latex?
http://www.physicsforums.com/attachment.php?attachmentid=20450&stc=1&d=1252317887
Thanks in advance
Hi there,
Do you desperately want to draw a picture in LaTeX??? If so, you can always do it in the figure environment: \begin{figure} \end{figure}. From this environment, you will need to tell LaTeX what, where, and how each piece of the drawing should be placed. As you can imagine, even for a very small figure, you need to add many, many, many commands, which become terribly cumbersome.
I suggest you to use a drawing environment, like gimp or xfig (opensource), to draw your pciture. Then you simply need to include it in your text wherever you want to. I believe you will save alot of time and effort.
Cheers
Hi there,
Do you desperately want to draw a picture in LaTeX??? If so, you can always do it in the figure environment: \begin{figure} \end{figure}. From this environment, you will need to tell LaTeX what, where, and how each piece of the drawing should be placed. As you can imagine, even for a very small figure, you need to add many, many, many commands, which become terribly cumbersome.
I suggest you to use a drawing environment, like gimp or xfig (opensource), to draw your pciture. Then you simply need to include it in your text wherever you want to. I believe you will save alot of time and effort.
Cheers
There are figures (.eps files) that I must add them using the figure enviroment, and I already did. But I want to draw schematic diagrams to illustrate something like the figure I attached in the first post. I have downloaded the pgf package, but I don't know where to start, its manual quite long and doesn't give you things in direct way, where I have to deliver my thesis soon.
Regards
I have downloaded the pgf package, but I don't know where to start, its manual quite long and doesn't give you things in direct way, where I have to deliver my thesis soon.
That is the problem with drawing directly in LaTeX: it's quite long. On top of it, you will have to compile very often, to see the output result of your picture, which will consume more time.
To answer your question simply, the only I made drawing directly in LaTeX is by reading part of the manual (the one that could be necessary for you). Try and see the output result. I am sure that when you get to know the package, you can come up with decent results in no time. But at first, and specially if you are in a bit of hurry, I suggest you look into something like xfig (Winfig for MS Windows). You will be able to make this drawing, and save it into a .eps file.
Cheers
Check out
http://tug.org/PSTricks/main.cgi?file=examples#ring
PSTricks. It has latex examples if you download the packages. One is a ring diagram, and there are other flow charts/etc. Just download the examples and modify them.
las3rjock
Sep11-09, 10:50 PM
The following code will draw the figure you want using the pgf/TikZ package that you downloaded:
\documentclass[12pt]{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
\begin{center}
\begin{tikzpicture}
% draw nodes (pgf/TikZ v2.00 manual sections 3.4, 3.7, 3.9)
\node (source) at (0,0) [circle,draw,label=below:Source] {$S$};
\node (relay) at (3,2) [circle,draw,label=below:Relay] {$R$};
\node (destination) at (6,0) [circle,draw,label=below:Destination] {$D$};
% connect nodes (pgf/TikZ v2.00 manual section 3.11)
\draw [->] (source.60) to node [auto] {$\alpha_1$} (relay.west);
\draw [->] (relay.east) to node [auto] {$\alpha_2$} (destination.120);
\draw [->] (source.east) to node [auto,swap] {$\alpha_0$} (destination.west);
\end{tikzpicture}
\end{center}
\caption{\label{fig:SRD} Source-relay-destination figure.}
\end{figure}
\end{document}
http://www.physicsforums.com/attachment.php?attachmentid=20521&stc=1&d=1252724521
S_David
Sep12-09, 03:58 AM
That is fantastic las3rjock. Actually, I drew it previousely, but this code has more flexibility.
Thank you
vBulletin® v3.7.6, Copyright ©2000-2009, Jelsoft Enterprises Ltd.