TikZ is a higher-level drawing language built on top of the PGF graphics framework. For questions specifically about the PGF layer use {pgf-core} instead. Both tags are possible on the same question. The tag {diagrams} is also compatible with this tag.

learn more… | top users | synonyms (3)

2
votes
1answer
206 views

how to decrease the size of the circle?

I want to draw a binary tree like this: I have come up with the code below, but the size of the circle is too large. I tried to decrease the size, however, failed, can someone tell me how? ...
14
votes
2answers
2k views

Set table background hatched and shaded using tikz

I am looking for a convenient way to set the background of tabular cells. I'd like to do two things: (1) Set the background shaded in a color (2) Set the background hatched I learned that the TikZ ...
4
votes
1answer
520 views

how to draw arrow that looks like the symbol “\leadsto” in latex?

please refer to the answer of how to draw a process flow figure? Now I what to change all arrows look like \leadsto in latex, you are refer to the picture I can not find it in the manual, ...
2
votes
1answer
244 views

Add numbers to snake(box plot)

I have the following code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows,backgrounds,snakes} \begin{document} \begin{tikzpicture} [thick, framed] \filldraw[fill=green!20] ...
2
votes
1answer
2k views

How to make a connection in a tree with a dashed line?

please refer to the answer of how to draw a process flow figure? Now I want to change the line of "and->path1" to the dashed line, i added [style=dashed], unfortunately it doesn't change, why? ...
40
votes
2answers
2k views

Fitting text to a shape in TikZ

I am designing a poster, which has some geometrical shapes (TikZ paths) surrounded by some text. I would like the text to flow neatly around these shapes. I bet there's some clever TikZ magic that ...
7
votes
1answer
797 views

Beamer with Tikzpicture. How to change scale of picture and distance between lines of nodes?

I am a beginner in LaTeX, trying to convert a presentation in beamer. I am experiencing difficulties with the scale option that does not seem to work, and I cound not find a way to reduce slightly ...
4
votes
1answer
582 views

how to draw a process flow figure?

I want to draw the process like in the picture using the code below, however, there is some problem, would someone help me? \usepackage[latin1]{inputenc} \usetikzlibrary{trees} ...
15
votes
2answers
3k views

Using TikZ coordinates in expressions?

I would like to be able to calculate two new \coordinates by starting from two existing coordinates. I have defined two coordinates c1 and c2. A minimal example would be \documentclass{report} ...
2
votes
1answer
473 views

Shorten Tikz Edges from node to node

I am making simple Finite State Machines for a paper. My code is listed below: %\usetikzlibrary{arrows,automata} in the preamble \begin{tikzpicture}[>=stealth', auto,node distance=2.75cm] ...
8
votes
2answers
413 views

Getting last value in tikz foreach

I tried this, but it doesn't work as intended: \foreach \x/\index in {4/0,5/1,19/2} { \ifnum \index > 0 % use lastx \fi \pgfmathsetmacro\lastx{\x} } How do I set \lastx properly?
4
votes
1answer
443 views

Labeling a box in tikz

As shown in the working example below, I have red box around all the boxes. I want to label the box but I couldn't manage to do it. I tried to use some of the ways in given in the tikz examples but I ...
5
votes
1answer
284 views

Unexpected output using tikz/textpos

The following code (MWE) \documentclass[a4paper]{article} \usepackage{tikz} \usepackage[absolute]{textpos} \usetikzlibrary{external} \tikzexternalize \begin{document} ...
7
votes
2answers
2k views

TIKZ-PGF: Align two text-nodes to the left

I want to draw two text nodes in tikz-figure where the text is aligned left and not centered: \documentclass{article} \usepackage{tikz} \begin{document} \begin{figure} \begin{tikzpicture} \node ...
9
votes
2answers
2k views

Placing a figure inside a multirow table cell

Is it possible to place a figure within a multirow cell? The vertical alignment is ruined. Does it have to do anything with tikz's bounding boxes? The following mwe produces the following result ...
5
votes
2answers
347 views

TiKZ drawing routine or function

Say I wanted to define a function in TiKz for drawing an eye: \begin{tikzpicture} %eye \pgfmathsetmacro{\eyeSize}{1} \pgfmathsetmacro{\ex}{0} \pgfmathsetmacro{\ey}{1} \pgfmathsetmacro{\eRot}{-10} ...
2
votes
0answers
66 views

Arrow half straight line half dotted [duplicate]

Possible Duplicate: Draw a path with dashed start and solid end Can anyone help me figure out how to draw an arrow that is half straight line and half dotted? Much appreciated!
9
votes
1answer
1k views

TikZ diagonal text

Can you rotate text diagonally in TikZ / latex? I tried \coordinate (P) at (0,0) ; \draw[rotate around={45:(P)}] (P) node {hello} ; But it just draws the text straight (horizontally). I want the ...
10
votes
2answers
743 views

pgfplots quadrics

I wonder whether it is possible to draw the three following quadric surfaces (cone, hyperboloids) x^2+y^2-z^2=0 x^2+y^2-z^2=1 x^2+y^2-z^2=-1 (and the axis) using pgfplots 3d or TikZ as it is ...
3
votes
1answer
467 views

tikzpicture draw inside node/frame

I'm trying to reproduce a picture and I'm having a problem (since this is my very first experience with tikzpictures). The picture is the following: My problem is of how to create the part that is ...
8
votes
1answer
331 views

How can I move the position of a label inside a node?

I just started using TikZ an it's amazing. But I can't find out how to change the position of the label inside a node. At the moment I've: \node (DataAccess) at (0,2) [draw,thick,minimum ...
9
votes
1answer
10k views

Drawing a TikZ arc specifying the center

The TiKz command for an arc: \draw (0,0) arc (-30:30:2) ; Draws an arc that starts at (0,0), and would be the part of the circle from -30 degrees to +30 degrees of radius 2. It is very hard to ...
5
votes
3answers
250 views

labeling with words with counter, using lists

I'm sure it's very easy: I want to draw a circle and at specific, equally spaced angles display some words. So I can draw the circle as curved arrows using a \foreach. How can I use the same \foreach ...
14
votes
1answer
717 views

TikZ datavisualization or pgfplots?

I want to create a few plots that should have the same style as my main document and it seems tikz is more than capable of achieving that. Now while browsing the current tikz documentation (2.10 ...
8
votes
2answers
209 views

Behavior of dot operator in node relative placement

In placing a new node using relative positioning, what is the behavior of the dot operator when referring to an existing named node? For example, if xc is an existing named node, what does the ...
29
votes
5answers
10k views

Draw arc in tikz when center of circle is specified

It would be convenient sometimes to be able to draw an arc in tikz by specifying the center of the corresponding circle its radius the initial/final angle i.e., the "natural" way an arc is ...
7
votes
3answers
1k views

extract x value from coordinate in TikZ

maybe I'm stupid, I looked at the many examples in which somehow shows the work with the coordinates, but I don't understand it. Simple example - I have: \begin{tikzpicture} \coordinate ...
7
votes
3answers
297 views

How can I determine the size of an array?

After a long search period, I was not able to figure out how to determine and use the len of an array like this: \def\mar{ 1,2 } \path let \p1=($(rec.west)-(rec.east)$), ...
13
votes
1answer
451 views

TiKz dash dash plus plus

Unfortunately due to the way search engines work, this information isn't that easy to find. Sometimes examples draw using --, sometimes -- +, sometimes -- ++. I don't get the meaning! For example, ...
2
votes
1answer
740 views

Setting coordinate system for TiKZ picture

I'd like to use TiKZ to generate stand-alone PDF diagrams programatically. I have an application that generates simple geometry of lines and arcs etc and I'd like to create (using e.g. Ruby) TikZ ...
5
votes
1answer
358 views

Independent Columns Environment

I am creating a two-page syllabus with a tikz calendar in the left column and all of the content on the right side of the page. Currently the right content is just like a normal article class document ...
9
votes
1answer
2k views

Aligning a Tikz Picture in line with the surrounding Text

I'd like to align a Tikz Picture in line with the surrounding Text. Here is a MWE Example: \documentclass[a4paper,10pt]{article} \usepackage{tikz} ...
3
votes
1answer
266 views

Problems with nested comments and figures

Now this problem is probably too localized, but I do not see anywhere else to get help solving it. I have a large amount of important files, and these stopped compiling after switching from MikTex to ...
4
votes
1answer
162 views

Random scale of square makes a rectangle

Why does this code generates a rectangle, not a square? \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[scale=rnd] (0,0) rectangle (1,1); ...
9
votes
1answer
112 views

Defining and passing arguments

I would like to pass the arguments ->,line width=1.2pt to command \draw [] ... However, this does not work \newcommand\newstyle{->,line width=1.2pt} \draw[\newstyle] Is there any way to ...
1
vote
0answers
43 views

pgfplots: How to change the alignment of one single node [duplicate]

Possible Duplicate: How to display labels on points of a tikz plot I plot a scatter plot using pgfplots and automatically label every single mark with its description. When two marks are ...
16
votes
3answers
2k views

How can I know the default PGF line width?

Is there some macro that will tell me what the default PGF line width is? I have tried creating my own macro by cloning \pgflinewidth before it has been modified, i.e. ...
3
votes
1answer
768 views

TikZ edge thickness causing errors in foreach loop

I'm experiencing some weirdness in making a simple TikZ diagram (a comb-shaped graph with variable number of nodes). The weirdness comes from the style applied to the edge paths. Here's the ...
5
votes
2answers
1k views

PGFPlots: line opacity gradient?

Imagine a very simple PGFPlot, e.g.: \begin{tikzpicture} \begin{axis} \addplot+[no marks]{x^2}; \end{axis} \end{tikzpicture} How can I have the line "fade out" from the left to the right of the ...
14
votes
3answers
3k views

Plotting parametric curves

I am trying to plot some parametric curves, however I always get an an error saying "Dimension is too large". Is there any way to fix this? \begin{tikzpicture}[scale=.2] \draw[very ...
8
votes
1answer
406 views

Error when creating a surf plot with matlab2tikz

I'm using matlab2tikz to generate the tikz code for my figures. When compiling the document with the figure code as below, i get an error: Package pgfplots Error: No such element: ...
2
votes
1answer
560 views

is it possible to include tikz picture from a file

I have a tikz picture in a tex file \begin{figure}[ht!] \begin{center} \resizebox{.4\textwidth}{!}{\begin{tikzpicture}[ .... \end{tikzpicture}} \end{center} \end{figure} The ... portion is quite ...
5
votes
1answer
344 views

Automatic generation of tikzfading

I have a question similar to TikZ Fading Speed and defining a fading-style directly in the fill command but I can't figure out how to get a nice solution. I would like to, given a list of increasing ...
7
votes
2answers
803 views

TikZ/PGF: Simple function is not plotted. Where is the mistake?

I'm just starting to learn TikZ/PGF. I would like to draw a simple function, f(x) = x² to start with. \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
11
votes
2answers
1k views

Custom shapes in TikZ

I am trying to define a new shape in TikZ following the instructions of section 75.5 of the manual. Reading the question Drawing mechanical systems in LaTeX, I started to think that a "mechanical" ...
16
votes
2answers
2k views

Use a custom shape as a “building block”

I want to create a custom shape (not a big one) and use it in custom places. The shape is a camera and is quite simple: \draw [fill=black](0,0) -- (2,2.5) -- (-2,2.5) -- cycle; \draw ...
5
votes
1answer
244 views

Auto Generate Table with Tons of + and -

i want to create a table containing lots of "+","-" and "0", which depend on the column and row number by (quite simple) mathematical formulas which are known to me. I could enter the signs by hand ...
7
votes
1answer
161 views

TikZ: Access coordinates of decorated paths?

Is it possible to access the coordinates of the decoration of some paths? I draw two paths, e.g., with: \begin{figure}[t] \begin{tikzpicture} \draw [red,decorate,decoration={crosses, ...
6
votes
1answer
239 views

how to split a rectangle?

I hope somebody can help me. I am search for a split of a rectangle like this: \node[rectangle,draw,minimum width=3cm, minimum height=3cm] (rec) {}; \node[name=v1,minimum width=3cm * 0.16cm] at ...
6
votes
1answer
3k views

3D surface plots in TikZ

I need to plot a surface plot using TikZ. I have the (x,y) coordinate and the corresponding function value in a table form. I have not done 3D plots before in TikZ and hence I would appreciate any ...