Graphics, Figures & TablesWriting on Graphs

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Writing on Graphs

Post by S_David »

Hello,

I am using the pgf package to draw with Latex. I have the following piece of code:

Code: Select all

\documentclass[a4paper,12pt,openany,oneside]{memoir}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}[thick, inner sep=3mm]
\node (relay) at ( 0,4) [circle,draw,label=above:R] {}; 
\node (destination) at (2,2) [circle,draw,label=right:D] {};
\node (source) at (-2,2) [circle,draw, label=left:S] {}; 
\draw [->] (source) to (relay); 
\draw [->] (source) to (destination);
\draw [->] (relay) to (destination);
\end{tikzpicture}
\end{center}
\end{document}
I want to write above the lines, and I want in some cases to make the lines thicker to indicate something. How can I do those?

Thanks in advance

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Writing on Graphs

Post by Stefan Kottwitz »

Hi,

use nodes for labeling and the thick or the very thick option for draw like

Code: Select all

\draw [very thick, ->] (source) -- node[above, sloped] {label} (relay);
Stefan
LaTeX.org admin
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Re: Writing on Graphs

Post by S_David »

Thank you Stefan_K.

Best regards
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Writing on Graphs

Post by S_David »

Stefan_K wrote:Hi,

use nodes for labeling and the thick or the very thick option for draw like

Code: Select all

\draw [very thick, ->] (source) -- node[above, sloped] {label} (relay);
Stefan
Hello,

I have a little problem, when I integrate this segment of code within the document, the figure didn't appear, when converting the dvi output to pdf, and the page where the figure should appear is a blank page (there is a text shold appear below the figure, the doesn't). Why?

Regards
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Writing on Graphs

Post by localghost »

There should be some warnings or error messages in the log file. Check this. Add the \listfiles command as very first line to your code and start a new run. Search the log file for the section between *File List* and *********** and post this list here.


Best regards
Thorsten
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Writing on Graphs

Post by S_David »

localghost wrote:There should be some warnings or error messages in the log file. Check this. Add the \listfiles command as very first line to your code and start a new run. Search the log file for the section between *File List* and *********** and post this list here.


Best regards
Thorsten
This is what I got:

Code: Select all

*File List*
  memoir.cls    2009/07/24 v1.6180339h configurable book, report, article docum
ent class
   ifpdf.sty    2007/12/12 v1.6 Provides the ifpdf switch (HO)
 ifxetex.sty    2008/09/18 v0.4 Provides ifxetex conditional
ifluatex.sty    2007/12/12 v1.0 Provides the ifluatex switch (HO)
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
   mem12.clo    2008/01/30 v0.4 memoir class 12pt size option
mempatch.sty    2009/07/24 v6.0f Patches for memoir class v1.6180339
    tikz.sty    2008/02/13 v2.00 (rcs-revision 1.27)
     pgf.sty    2008/01/15 v2.00 (rcs-revision 1.12)
  pgfrcs.sty    2008/02/20 v2.00 (rcs-revision 1.21)
  pgfrcs.code.tex
 pgfcore.sty    2008/01/15 v2.00 (rcs-revision 1.6)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
graphics.sty    2006/02/20 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
  pgfsys.sty    2008/02/07 v2.00 (rcs-revision 1.31)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2008/01/23  (rcs-revision 1.6)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v2.00 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.00 (rcs-revision 1.1)
  pgffor.sty    2007/11/07 v2.00 (rcs-revision 1.8)
  pgffor.code.tex
    tikz.code.tex
 ***********

 ) 
Here is how much of TeX's memory you used:
 9911 strings out of 95305
 159612 string characters out of 1183060
 248792 words of memory out of 1500000
 13008 multiletter control sequences out of 110000
 7028 words of font info for 25 fonts, out of 3000000 for 5000
 14 hyphenation exceptions out of 8191
 52i,11n,53p,353b,646s stack positions out of 5000i,500n,10000p,200000b,50000s

Output written on Graphs.dvi (1 page, 7712 bytes).
Is this what you want?

Regards
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Writing on Graphs

Post by Stefan Kottwitz »

S_David wrote:the figure didn't appear, when converting the dvi output to pdf, and the page where the figure should appear is a blank page
I think that's the point - it could happen with dvipdfmx or the like. Instead of converting directly from dvi to pdf convert to ps first (dvips) and then to pdf (pstopdf), or use pdfLaTeX if possible.

Stefan
LaTeX.org admin
S_David
Posts: 45
Joined: Tue Jul 07, 2009 4:16 am

Writing on Graphs

Post by S_David »

Stefan_K wrote:
S_David wrote:the figure didn't appear, when converting the dvi output to pdf, and the page where the figure should appear is a blank page
I think that's the point - it could happen with dvipdfmx or the like. Instead of converting directly from dvi to pdf convert to ps first (dvips) and then to pdf (pstopdf), or use pdfLaTeX if possible.

Stefan
Yes, right, it is working now.

Thanks
Post Reply