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)

21
votes
6answers
3k 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
888 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 ...
14
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
618 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
1k 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
826 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 ...
13
votes
1answer
4k 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 ...
15
votes
6answers
13k 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
260 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
223 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
1k 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
2k 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
364 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} ...
3
votes
0answers
295 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
190 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{ ...
4
votes
2answers
1k 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
4k 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
586 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
6k 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 ...
13
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
979 views

Balanced Scorecard diagram

I want to make a Balanced Scorecard diagram in tikz. Is there an example already?
9
votes
2answers
2k views

Declaring layers causes tikzpicture to disappear

I'm using a picture environment to \put some tikzpictures at places within the page from within \setkomavar{firsthead}. When I declare some pgf layers like so: \pgfdeclarelayer{background} ...
15
votes
1answer
2k views

Quiver scale in pgfplots (unit scaling)

Quiver plots can be made within pgfplots. Here is a minimal example which is a vector field of [1, x-y]: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} ...
20
votes
2answers
2k views

Highlighting Extremal Values in Table

In a table generated by pgfplotstable, how can I highlight for each column or row the cell with the minimum value (e. g. displaying the corresponding entry in bold face)? Example:
9
votes
2answers
4k views

domain option for pgfplot's \addplot ignored?

I want to do a simple plot of goniometric functions with pgf in a beamer presentation: \usepackage{tikz,pgfplots} % ... \begin{tikzpicture} \begin{axis}\addplot[domain=0:pi]{sin(deg(x))}; ...
13
votes
1answer
2k views

tikzpicture of several springs

I'm trying to reproduce in like the following picture: Actually I would like to slightly modifies it as I would like all the spring to be connected to a common wall at the top. I have begin it with ...
15
votes
1answer
631 views

Automatic linking (aka code highlight) in Till Tantau's `codeexample`

I am writing docs for a tikz-based package, and I am trying to reuse Till Tantau's codeexample environment to output source code along with its output. However, I cannot manage to get syntax ...
2
votes
1answer
45 views

in=down modifier breaks \draw command when coordinate is returned by macro

Another Minimal Non-Working Example... \documentclass{article} \usepackage{tikz} \begin{document} \newlength\mylength \setlength\mylength{20pt} \newcommand*\mypoint{\mylength,20pt} ...
4
votes
1answer
220 views

Problem using coordinate returned by macro for drawing line

Why does this MNWE (Minimal Non-Working Example) fail? \documentclass{article} \usepackage{tikz} \begin{document} \newcommand\mypoint{(1pt,0pt)} \begin{tikzpicture} \node [draw,circle] at ...
1
vote
1answer
2k views

Some simple surface drawing using addplot3 for pgfplots won't compile

I am having trouble compiling even some very simple surface drawing using pgfplot and addplot3, for example please see the attached code, I keep getting error saying \begin{axis} on input line 8 ended ...
3
votes
1answer
270 views

Problematic interaction between ltxdoc and tikz matrices

I have been spending some time trying to solve a problem in the interaction between TikZ matrices and the ltxdoc document class. While using ltxdoc, I cannot use the |[options]| syntax at the ...
1
vote
1answer
389 views

Customize diameter of a circle around numbers

The following code gives one good solution for displaying numbers in cricle but it would be better to have the possibility to control the size of the circle. Why ? In the example below you will see ...
8
votes
2answers
3k views

TIKZ : How to decorate a \path?

My question is about drawing a "commutative-type diagram" in mathematics. I would like to integrate an arrow of the type \rightsquigarrow, which is described how to be obtained here : Squiggly arrows ...
7
votes
1answer
1k views

How to right align a table in a tikz picture

I currently have set up a command that draws a box with a shadow and some text inside that box. I want it to have a minimum-width, but when I set it, the table is now aligned in the center of the box ...
10
votes
1answer
1k views

TikZ: Fill (closed) parametric plot of catacaustic

Is there a trick to fill the parametric plot of a catacaustic which looks closed but isn’t closed in TiKZ meaning. The Problem is the egdge which looks closed but isn’t it … I guess I can ...
12
votes
4answers
10k views

Is there a TikZ dashed line decorator or some other way to make part of a path dashed?

The problem I would like to draw a parabolic path in TikZ that changes (abruptly) from a continuous line to a dashed line. The obvious way to change the appearance of a path over the course of its ...
43
votes
5answers
10k views

Extract x, y coordinate of an arbitrary point in TikZ

I need a macro to extract the x and y coordinates from an arbitrary point, like (3,4), or like (A), or like ([xshift=-2pt] A.north west), where A is the name of a node. I've seen the solution ...
2
votes
1answer
3k views

Tikz library `external` produces error if package `optional` is loaded?

I'm working on a large document which exceeded the memory capacity of TexLive 2011 so I tried to externalize the tikz images by using it's external library, as described in pgfmanual. I compiled ...
7
votes
1answer
2k views

Relationship between tikz circuit library and circuitikz?

Is there any relationship between tikz circuit library and circuitikz, for example that one is build on top of the other. Are they compatible in some way? Is one of them in some way obsolete?
9
votes
1answer
1k views

Clipping tikz and raster pictures zigzag style

Is there a way to achieve this kind of clipping for raster images as well, not only for tikz pictures? -- Solved, see Edit #1. Are there any easier solution to achieve this with TikZ? -- Solved, see ...
3
votes
4answers
3k views

Battery symbol in circuitikz [duplicate]

Is it possible to make circuitikz draw battery-symbols like this:
3
votes
1answer
531 views

Highlight entries in Table of Contents with coloured rectangles using TikZ an tocloft

The solution presented in How to highlight specific entries in a tocloft-formatted ToC did not work for colored background. There is a problem when using color because the colored rectangles are ...
12
votes
1answer
697 views

Enter matrices by columns rather than rows in TikZ

I find myself drawing a lot of quantum circuits these days, and I do them in TikZ because it produces very nice diagrams. A quantum circuit is a lot like staff (as in music). You go from left to ...
99
votes
3answers
42k views

Easy curves in TikZ

I find myself needing to draw lots of elegantly curved paths in TikZ. Ideally, I'd just specify a series of points, and TikZ would calculate the extra data itself to draw a nice series of curves ...
15
votes
2answers
847 views

Bug in TikZ? Line width on layers

I found a curios behavior in TikZ. If I set the line width globaly or for the current scope it wont affect the line with inside a {pgfonlayer} but the arrow tips are changed: Did I found a bug and ...
8
votes
4answers
2k views

Piecewise defined function in tikz or tkz-fct

How to define and plot a piecewise defined function in tikz or tkz-fct? For example consider the function f(x) = 1 for x < 0, x for 0 <= x < 1, cos(x) for x >= 1 Edit: After Torbjørn T.'s ...
2
votes
1answer
724 views

Legend with Markers for Mesh Plot

I use a mesh plot with scatter points (2d) where the colors are determined from a third coordinate of the data as described in this question. The legend however should contain the markers of a curve ...
3
votes
2answers
123 views

Set [out=up, in=down] as default path segment parameters

I'm drawing lots of paths that look like this: \draw (1) to [out=up, in=down] (2) to [out=up, in=down] (3) to [out=up, in=45] (3); Can I set the [out=up, in=down] part as a global default, to avoid ...