Graphics, Figures & Tables ⇒ Graph theory figures
Graph theory figures
I am using latex to draw graphs-those in graph theory
but when I compile the tex file, I get a bunch of error in pgfcorearrow.code.tex and other lib files, really strange
Help me please, I'd like to draw a graph, I have to hand in my report tomorrow, I don't like to embed image while drawing is feasible
\begin{tikzpicture}[scale=0.75,transform shape]
%graph1
\Vertex[x=0,y=0](A)
\Vertex[x=3,y=0](B)
\Vertex[x=0,y=-3](C)
\Vertex[x=3,y=-3](D)
\tikzstyle{LabelStyle}=[fill=gray!30,sloped]
\tikzstyle{EdgeStyle}=[bend left]
\Edge[label=$e_1$](A)(B)
\Edge[label=$e_2$](C)(B)
\Edge[label=$e_3$](A)(D)
\Edge[label=$e_4$](C)(D)
\Edge[label=$e_5$](D)(B)
\Edge[label=$e_6$](A)(C)
\end{tikzpicture}
Errors are shown as in below image
- Attachments
-
- untitled.PNG (190.58 KiB) Viewed 3332 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Graph theory figures
try this:
Code: Select all
\documentclass{article}
\usepackage{tkz-graph}
\begin{document}
\begin{tikzpicture}[scale=0.75,transform shape]
%graph1
\Vertex[x=0,y=0,L=A]{A}
\Vertex[x=3,y=0,L=B]{B}
\Vertex[x=0,y=-3,L=C]{C}
\Vertex[x=3,y=-3,L=D]{D}
\tikzstyle{LabelStyle}=[fill=gray!30,sloped]
\tikzstyle{EdgeStyle}=[bend left]
\Edge[label=$e_1$](A)(B)%
\Edge[label=$e_2$](C)(B)
\Edge[label=$e_3$](A)(D)
\Edge[label=$e_4$](C)(D)
\Edge[label=$e_5$](D)(B)
\Edge[label=$e_6$](A)(C)
\end{tikzpicture}
\end{document}