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)

5
votes
2answers
1k views

tkz-euclide changing labels and size (triangle, inscribed circle)

A friend of me Torbjørn, showed me how to build the image below using tikz with the following code. \documentclass{article} \usepackage{tkz-euclide} \usetkzobj{all} ...
15
votes
3answers
8k views

changing loop size and shape in tikz

I would like to make the small loop around the circle (loop above) a bit rounder and nicer. below is a short example of my code: \documentclass{scrbook} \usepackage{tikz} ...
7
votes
1answer
982 views

Compute asin from y-value of a coordinate or: Angle between two lines in tikz

Edit (The almost ultimate solution) After sorting everything out and having some nice code - thanks to cjorssen :) - I cam up with a general solution with which you are able to use the connector with ...
9
votes
2answers
3k views

Remove rows in a \addplot table command

Is there any way to adapt Show last N rows from input datafile only in \pgfplotstabletypeset to a \addplot table command ? This doesn't work: \documentclass{article} \usepackage{pgfplots} ...
4
votes
1answer
1k views

Drawing a Cube Using Tikz

I'm trying to simply use the example of a cube provided here \begin{tikzpicture}[ back line/.style={densely dotted}, cross line/.style={preaction={draw=white, -, line width=6pt}}] \matrix (m) ...
11
votes
3answers
1k views

Hexagon with exscribed triangle

I am learning tikz now, it is painfully slow, but I am slowly learning. I am trying to reproduce the image below. Here is my code so far. This is basically a rip of from the pgf manual. ...
20
votes
2answers
2k views

Tikz Polar Grid

I'm working on a Smith Chart using TikZ. Currently I'm writing it with everything scaled to a unit circle (centered on 0,0 with a radius of 1) without units. Then scaling so it's a reasonably sized ...
8
votes
2answers
6k views

How do you get two lines between nodes that have paths to each other instead of a double ended line? [duplicate]

Possible Duplicate: Double arrow in TIKZ? \begin{tikzpicture} [->,>=stealth',shorten >=1pt,auto,node distance=1.5cm,semithick,font=\tiny] \tikzstyle{every state}= ...
7
votes
2answers
2k views

Passing arguments to \def inside \newcommand (TikZ/PGF)

I'm having trouble passing an argument to \pgfmathparse inside a macro I defined. Here is the code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \newcommand{\drawmestg}[2]{ ...
4
votes
2answers
2k views

pgf-tikz problem with 'declare function'

I need to make a plot of a non-linear functions. To get familiar with the 'declare function' capability of pgf-tikz, I tried the following code: \documentclass[10pt]{article} \usepackage{amsmath} ...
19
votes
1answer
2k views

Maintaining layout of Tikz diagrams with TeX4ht (converting as single pictures)

A Tikz diagram such as \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \path (0,0) node[draw] (A) {A}; \path (2,0) node[draw] (B) {B}; \draw (A) -- (B) ...
5
votes
2answers
577 views

Making mixed trees with and without text-containing nodes

I’m using TikZ to draw linguistic syntax trees where some nodes have textual labels and some nodes don’t. I’d like the branch from a labelless node to continue at the same angle into the right hand ...
4
votes
1answer
245 views

Multiple listings using range markers and PGF's \foreach

I've been trying to include multiple code snippets from a unique source file by using listings's range markers (named lines) and PGF's \foreach macro: \foreach \x in {1,2,...,8} { ...
4
votes
1answer
1k views

String list in tikz foreach

I'm trying to draw some repeated with PGF/Tikz, and I'm using a foreach. Problem: each line has, on the right, a description, which is a string of text - which may be somewhat long and contain commas ...
8
votes
1answer
1k views

Tikz - Marking nodes in a binary tree?

I need help marking nodes in a binary tree. I've tried drawing this using the fitting library in tikz, but the fit would cover other undesired nodes as well. Please help. The code I tried is here ...
6
votes
1answer
921 views

User-defined math functions with pgf

I'm trying to use user-defined math functions with pgf to make a plot. The plot will consist of several straight lines given by a function of three arguments. (I know there are easier ways to do this, ...
20
votes
3answers
777 views

How to extend TikZ drawing commands

I would like to create a carc path macro (centered arc, that acts like circle, without changing the current position) in a way to be able to write : \draw (0,0) carc(30:90:1) carc(30:90:2) ...
11
votes
1answer
3k views

Drawing an arrow tip to every node of a path

I want to draw an arrow tip to every node/coordinate in a path. But tikz draws them only to the first and last point. Is there an option for that purpose? Or have I to splitt the path into its single ...
25
votes
2answers
1k views

Using the same picture over and over?

Suppose I have a complex figure made ​​with TikZ. How do I use it several times without having to repeat all the commands? \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} ...
1
vote
2answers
295 views

Why am I getting a frame number of 2? [closed]

Using tikz/matrix inside beamer, I have several slides with a wrong page/frame count. Why is that so, and how can I avoid it? MWE: \documentclass[14pt]{beamer} \usepackage{tikz} ...
10
votes
3answers
701 views

Not repeating myself so much in TikZ diagrams

I am writing a document which defines a network protocol. I illustrate key message exchanges with diagrams like this: The TikZ source for this diagram is: \documentclass{article} ...
17
votes
1answer
862 views

How can I have a subpicture in a tikzpicture?

This is a problem that's come up from time to time as an aspect of a question, and it's something that I think would be an extremely useful addition to the TikZ/PGF system. The basic set-up is to be ...
13
votes
2answers
1k views

TikZ style attribute for adding default node text?

Is there a TikZ style attribute for adding default text to a node? For instance, I want to be able to do something like the following: \begin{tikzpicture}[% stuff/.style={% draw, text=Bla ...
11
votes
2answers
2k views

Which are the advantages of TikZ over GeoGebra?

Now I have been using GeoGebra for a considerable amount of time and therefore I am rather experienced using it. Creating graphs, plots and geometric figures can be done in a matter of minutes. Often ...
7
votes
1answer
783 views

tikz: plot stepped gauss

I need to plot a stepped gauss curve as shown below. Yet I want to do this dynamically (in text) so I can alter it later. I know how to plot a smooth gauss but I really need the stepped one. Also a ...
7
votes
2answers
272 views

Aligning the bottom of a picture and a chapter title

Consider the following example, where the chapter number is ginormous and put in a blue box: \documentclass[svgnames]{scrbook} \usepackage{titlesec} \usepackage{tocloft} \usepackage{tikz} ...
7
votes
3answers
1k views

More advanced tikz images, trees

Below I have some images i need to 'Tikzify' I would preffer to learn how to make these, and I will. But for now could anyone please show me how to make these? I am not looking for an exact replica, ...
21
votes
6answers
2k views

Best way to create this image, square and angle

I have just started looking into tikz, and trying to create the simple image below. I took a stab at it but could not quite do it. ABCD is a square and E is the midpoint on DC and F is the midpoint ...
11
votes
4answers
737 views

Simple line with dots, known coordinates

Are there any easy way to make something similar to this image in tikz, asympote or similar? I know the coordinates, to each of the points =) Ofcourse I know how to solve this, but to do it in ...
12
votes
3answers
2k views

Is there a way in TikZ to reflect regular polygons of an arbitrary number of edges?

Is there a way in TikZ to reflect regular polygons of an arbitrary number of edges, along each edge-considered-as-mirror? I'm using MacTeX, and I'm new to LaTeX, pgf and TikZ. I'd like to do this ...
13
votes
1answer
3k views

pgf/tikz vs metapost

Can the experts here comment on the pros and cons of these two languages? I have been using metapost for a long time and I was wondering if I should learn pgf/tikz also. How does both languages ...
1
vote
1answer
533 views

Problem with arrows between nodes

I need to draw an arrow between 2 nodes but not from the center of the node. When I use a position modificator a new arrow end appears at the starting point. This is a minimal example: ...
3
votes
1answer
862 views

How to typeset Cyrillic characters in tikzpicture nodes?

So I have this tikzpicture environment (dot2texi-generated): \documentclass{beamer} \usepackage[T2A,T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english,russian]{babel} \usepackage{tikz} ...
8
votes
1answer
725 views

Recursive method to build a tree with tikz

I would like to translate the next example of a Bernoulli tree built with pst-tree with tikz but I don't know if it's possible : \documentclass{article} \usepackage{pstricks,pst-tree} \makeatletter ...
11
votes
1answer
3k views

How to join underbrace/overbrace between nodes

I draw the following horizontal line with node and want to draw underbrace/overbrace between some nodes. Please let me know how to do that. %draw horizontal line \draw (0,0) -- (8,0); %draw ...
14
votes
6answers
11k views

How to export matlab figures to (pdf) LaTeX?

I am writing a student thesis in LaTeX and need to import several figures created in Matlab. I found some programs to do this task: matfig2pgf matlab2tikz fig2texPS The problem is that using one ...
10
votes
1answer
247 views

tikzpicture has a node whose text is a tree: unevenly formatting

I want to typeset a picture similar to the following one, using tikz. For that purpose I have written the following latex document \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{chains} ...
1
vote
0answers
222 views

Is there any package to model use diagrams of UML? [duplicate]

Possible Duplicate: Typsetting UML class diagrams I need to model some diagrams UML, specially use cases, but I didn't find a good package to do this, I found UML for LaTeX/MetaPost however ...
7
votes
1answer
994 views

Customizing the splitting line when using nodes with multiple text parts in TikZ?

I'm wondering, is it possible to customize the splitting line when defining a node which has multiple text parts? For instance, instead of a solid line, I would like it to be dotted or dashed. For ...
16
votes
1answer
1k views

Surface of Revolution

how to draw using surface of revolution tikz or pgfplots? \documentclass{article} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \end{tikzpicture} \end{document} I am not able to ...
3
votes
1answer
336 views

Incorrect evaluation of expression? [duplicate]

Possible Duplicate: How can I work around this TikZ bug? I am plotting points on function f(x)=1-x^2/2+x^4/16. Obviously f(x)=-f(x), but PGF does not think so. \documentclass{minimal} ...
2
votes
0answers
277 views

Vertical trees with TikZ [duplicate]

Possible Duplicate: Drawing a directory listing a la the tree command in TikZ Is there a way to configure the trees drawn by TikZ to have child nodes at the same level listed below each ...
2
votes
1answer
177 views

finding points on path with given x-coordinate (marking f(x) points for given x's)

A y=f(x) function is given as path; for a set of x-coordinates, I want to place node (x,f(x)) onto the path, and connect it with (x,0) with vertical line. I have not got very far myself: \tikz{ ...
3
votes
2answers
950 views

TikZ, multicolumn, and vertical spacing

My question is related to the vertical spacing of the objects in the page. I think that in my case TikZ can influence it. Here the MWE: \documentclass[12pt,letterpaper]{book} \usepackage{amsmath} ...
8
votes
5answers
3k views

Asymptotes in a plot

I'm using TikZ to plotting some functions for a document. For example, I want to plot 1/(x+1). So I did something like this: \begin{tikzpicture}[>=stealth,x=3mm,y=3mm] \draw (0,5) ...
2
votes
1answer
542 views

Footline placement after \begin{document}

I'm trying to place an image as a border in the footer (footline) of a beamer presentation. I've noticed that if I use \setbeamertemplate{footline}[large] after the \begin{document}, the vertical ...
8
votes
1answer
4k views

Spacing in pgfplots bar plot

I've been trying to plot an xbar graph using pgfplots within a tikzpicture. I want to be able to only show the yaxis on the left and the x axis on the bottom. When I set axis y line=left and axis x ...
25
votes
3answers
5k views

filling area between 2 functions, with shading

I would like to plot two (rather simple) functions f, g over domain -2:2 and fill the area between them. The fill color should be red if f > g and green if f < g (for example), and in later ...
12
votes
3answers
3k views

Variables in TikZ

I use TikZ to draw graphics in LaTeX. I'd like to do arithmetic on variables. For example I haves nodes named after N-1 and N-2 and I'd like to create the N-3 and N-4 nodes as +2 from the first nodes. ...
5
votes
1answer
861 views

Balanced Scorecard diagram

I want to make a Balanced Scorecard diagram in tikz. Is there an example already?