Hot answers tagged

11

Multi-dominance "trees" are not really trees, but graphs, and the standard tree drawing packages are really not designed to handle them. Depending on the complexity of the tree, it's possible to draw these trees, however, but it requires some manual intervention. I would use one of the TikZ based tree drawing packages for this rather than qtree. The two ...


8

To add a label next to an edge, use the syntax edge node {some text}. See for example the second tutorial in TikZ's manual, section 3.11 Adding text next to lines. Should you want to place the node on the other side of the line, use edge node[swap] {some text}. Note also that \tikzstyle is considered deprecated, you should use \tikzset or add the styles to ...


7

Use the L= option for \Vertex to have a different label: \documentclass{article} \usepackage{tkz-berge} \usepackage{lipsum} \begin{document} \begin{figure} \centering \begin{tikzpicture}[scale=0.75,transform shape] \tikzstyle{LabelStyle}=[fill=white,sloped] \Vertex[x=0,y=0]{A} \Vertex[x=-2,y=-1]{B} \Vertex[x=2,y=-1,L=B]{C} ...


7

Sorry I'm guilty. I have not taken sufficient precautions. The problem comes from : \newcommand*{\Edge}[1][]{\@edge[#1]}% because tikz-qtree defines `\@edge` too :( A better way was to use \tkz@edge instead of \@edge. In the next version with pgfkeys, I'll be more careful. Actually you can save the next file with the name : patch-tkz-graph.tex ...


7

With \SetUpEdge you could adapt the answers given in the question you mention. For example: \pgfarrowsdeclare{biggertip}{biggertip}{% \setlength{\arrowsize}{1pt} \addtolength{\arrowsize}{.5\pgflinewidth} \pgfarrowsrightextend{0} \pgfarrowsleftextend{-5\arrowsize} }{% \setlength{\arrowsize}{1pt} \addtolength{\arrowsize}{.5\pgflinewidth} ...


7

Using the calc library you can say something like \draw[dashed] ([yshift=60pt]$ (s)!0.5!(v1) $ ) -- ([yshift=-60pt]$ (s)!0.5!(v2) $ ); A complete example: \documentclass{article} \usepackage{tkz-graph} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} [scale=.8,auto=left,every node/.style={circle,fill=blue!20}] \tikzset{vertex/.style = ...


7

As the fit library has been mentioned a few times, here's a suggestion using that. It requires nodes, so all the black dots are created using \node. Note that by changing the node distance you can modify how stretched out the figure should be, in the y and x direction. The cross is drawn using a different technique, and relative to the nodes around it, so ...


6

Here is one attempt using tikz: The code: \documentclass[border=5mm,tikz]{standalone} \usepackage{mwe} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw(0,0)--(2,0)--(0,1)--(2,1)--(0,0); \draw(0,3)--(2,3); \draw[very thin, double distance=2pt](0.6,2.2)--(1.4,1.6); \draw[very thin, double ...


5

You can use adjustbox package and its adjustbox environment and to get a caption, use a figure environment: \begin{figure}[htbp] \begin{adjustbox}{max height=0.9\textheight,center} %% adjust max height your tikz code \end{adjustbox} \caption{This is my flow chart} \end{figure} Full code: \documentclass[a4paper,10pt]{article} ...


4

As, to be honest, I didn't feel like reading the tkz-berge manual, I threw together this example. The pgfonlayer is for drawing the edges in the background, thus behind the labels: \documentclass{article} \usepackage{tikz} \pgfdeclarelayer{background} \pgfsetlayers{background,main} \newcommand{\Vertex}[2]% pos, name { \node[circle,draw,minimum ...


4

Load the patterns library, and add pattern=<style> to the definition of VertexStyle, where <style> include, for example, horizontal lines, vertical lines, north east lines, north west lines, etc. Code \documentclass[12pt,a4paper]{article} \usepackage{tkz-graph} \usetikzlibrary{patterns} \begin{document} \begin{figure} \begin{tikzpicture} ...


4

Instead of explicitly defining a new counter \j you can use evaluate. Of course, this isn't much of a saving as you still need to define \j inside the evaluate statment, but it does save a loop: \documentclass{article} \usepackage{tikz} \usetikzlibrary{graphs} \usetikzlibrary{graphs.standard} \begin{document} \begin{tikzpicture}[every ...


3

Use pgfplots. Believe me, it is easy. \documentclass[border=4]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \begin{document} \begin{tikzpicture} \begin{axis}[width=7cm,%axis lines=left, xlabel={$\sum{t_i}\quad\longrightarrow$}, legend style = {legend pos=outer north east,cells={anchor=west}}, ymax=12, ...


3

This can (if desired) be done within a single \graph command: \documentclass[tikz,border=5]{standalone} \usetikzlibrary{graphs} \usetikzlibrary{graphs.standard} \begin{document} \begin{tikzpicture}[every node/.style={draw,circle,very thick}] \graph [clockwise] { subgraph C_n [n=5,name=A, radius=2cm]; subgraph I_n [n=5,name=B, radius=1cm]; ...


3

You can use Math option. But this can't be mixed with other vertices which are not having math content. Hence we have to split the entire line and use x and y values to position them properly: \Vertices{line}{0,1} \Vertex[Math,L=\ldots,x=4,y=0] {dots} \Vertices[x=6,y=0]{line}{i,i+1} \Vertex[Math,L=\ldots,x=10,y=0] {dots2} Full code: ...


3

Not sure if there is a simpler way, but some calculations lead to the code below. Note that 2.12 = 1.5*sqrt(2), and 1.06 = 1.5/sqrt(2). \documentclass{standalone} \usepackage{tkz-graph} \begin{document} \begin{tikzpicture}[scale=0.6, every node/.style={scale=0.6}] \SetGraphUnit{1.5} \GraphInit[vstyle=Normal] \SetVertexMath ...


3

Method a: The style for edges can be redefined locally: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[top=2in, bottom=1in, left=1in, right=1in]{geometry} \usepackage{tkz-graph} \begin{document} \begin{tikzpicture} \GraphInit[vstyle=Normal] % Vertices \Vertex[x=0, y=0] {4} \Vertex[x=4, y=4] {2} \Vertex[x=0, y=4] {1} \Vertex[x=2, ...


3

Sorry I need to translate the documentation of tkz-graph. First hte main idea of this package is to provide useful and simple macros and styles to the users. Finally you have two style to know : VertexStyle and EdgeStyle. When you want to draw a graph, you can choice a "general" style with \GraphInit[vstyle=Classic]. This is useful if all your graphs have ...


3

You have an old version of tkz-graph.sty in some directory searched by the TeX programs. You can find it by asking kpsewhich tkz-graph.sty which will return the file that's found first in the trees. Remove it: it is certainly outdated, as \listfiles tells, because the correct line should be tkz-graph.sty 2011/06/01 ctan v 1.00 base for graphs After ...


3

You can add labels to \Edges by adding e.g. label={Stuff} in the \Edge options. By default the label is placed on top of the arrow, you can shift it by changing the style of the label with e.g. labelstyle={above left}, which moves the label up and to the left. To get a more automatic label placement you can use the auto key, mentioned by Qrrbrbirlbel in a ...


3

As said in comments, there is unfortunately no English documentation available. Some of the options available to you are then to try to make sense of things from just looking at the examples in the documentation; ask specific questions about features in the package here; ask Alain directly, via email.


3

Perhaps I don't understand your question but you can use \grEmptyCycle if you want cycle without edges. Then you can mix macros from tkz-berge and tkz-graph. I don't understand the link between the question and \SetGraphUnit? this macro modifies the unit used to define the distance between the vertices. \documentclass{standalone} \usepackage{tikz} ...


3

You can add NoLabel to the vertices that shouldn't have a label. For those you can also remove Math,LPos=.., as those don't have any effect when there are no labels. \documentclass{article} \usepackage{tkz-graph} \begin{document} \begin{tikzpicture}[scale=2] \GraphInit[vstyle=Classic] \SetUpVertex[FillColor=black, MinSize=8pt] ...


2

Just for typing exercise with PSTricks. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-node,pst-plot,pgfmath} \psset{plotpoints=9,showpoints} \begin{document} \begin{pspicture}(-5,-5)(5,5) \foreach \c[count=\r from 1] in {A,...,D}{\curvepnodes{0}{360}{\r\space t PtoC}{\c}\psnline(0,8){\c}} \foreach \i in ...


2

You should add the option LineColor=red in \SetVertexNormal command.


2

There is a \Loop command for this, see the example on page 25 of the manual. The syntax is \Loop[<options>](<vertex>) without any spaces before/after brackets/parens. In the options one can specify dir - the possible values are WE, EA, NO, SO, NOWE, NOEA, SOWE, SOEA for west, east, north, south, north west etc., e.g. dir=NO. dist - ...


2

I assume you're using TikZ and tkz-graph … You can use the decoration.markings library to set a marking at the middle position. To the human eye this does not look like the middle, though, because only the tip of the arrow is halfway between (1) and (2). But you can use arbitrary TikZ code in the with {<code goes here>} part. I cloned the first ...


2

You need to include \usepackage{tkz-graph} in the preamble, after which you get: \documentclass{article} \usepackage{tkz-graph} \begin{document} \begin{tikzpicture} \GraphInit[vstyle=Classic] \Vertices[Lpos=90,unit=2]{circle}{A,B,C,D,E,F} \end{tikzpicture} \end{document}


2

A pure TikZ solution with help of `mathtools˙package: \documentclass[tikz,border=3mm]{standalone} \usetikzlibrary{chains,positioning} \usepackage{mathtools} \begin{document} \begin{tikzpicture}[ start chain = A going right, ] \begin{scope}[every node/.style={circle, draw, minimum size=1.5em, ...


1

The idea is to override the default inner sep and make it 0pt. For this, there are two options: Redefining \VertexInnerSep to make it 0pt as suggested in a comment. Using the VertexStyle style to append there the option. An example showing both options: \documentclass{article} \usepackage{tkz-graph} \begin{document} {% to keep the change local ...



Only top voted, non community-wiki answers of a minimum length are eligible