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)

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
337 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
953 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?
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} ...
14
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} ...
19
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:
8
votes
2answers
3k 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))}; ...
12
votes
1answer
1k 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
574 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
203 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
256 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
368 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 ...
7
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
7k 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 ...
37
votes
4answers
8k 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 ...
1
vote
1answer
2k 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 ...
5
votes
1answer
1k 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
983 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
3answers
2k views

Battery symbol in circuitikz

Is it possible to make circuitikz draw battery-symbols like this:
3
votes
1answer
455 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
666 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 ...
85
votes
2answers
29k 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
746 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
678 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
120 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 ...
12
votes
2answers
2k views

Horizontally enlarged hexagon with TikZ

I need to draw some nodes for a diagram, but I'm failing to produce a simple horizontally enlarged hexagon. If I use regular polygon (from shapes.geometric), I cannot enlarge it (first figure in ...
6
votes
3answers
1k views

How to draw a top to bottom block diagram (flowchart) using the schemabloc package

I looked at a few examples for drawing a flowchart and so I picked the schemabloc package. As I've worked with it, I've noticed, all the blocks are linked left to right or right to left. Although ...
16
votes
4answers
2k views

TikZ library for optics?

Is there a library (or something similar) available for optics including e.g. convex and concave lenses? I fount this but it seems that this is not available as an official library …
2
votes
1answer
466 views

Styled or fixed color line-segments in PGF

When I want to plot coordinate data, I know that I can color individual scatter points using defined colors using point meta=explicit. The line segments between two points seem to be colored by an ...
14
votes
2answers
2k views

Zooming on a data set in a picture (magnifying glass)

In my TeX document I would like to add a picture and in addition, zooming on a small part of the picture (e.g. inset in TeX or spy in TikZ). My question, I have a histogram 2D (f(x,y) = z) date which ...
5
votes
2answers
1k views

TikZ graph positioning

I am trying to use TikZ to include a simple graph in a short document, but I can't get to position the image properly. Sorry if it is a bit stupid, but this is the first time I am doing something like ...
4
votes
1answer
340 views

How can I create a diagram to compare skyline operation results using LaTeX?

I'm trying to draw this but except for the straight lines in this diagram I'm not able to place other things such as square and circle properly. How can I do this? Help much appreciated. EDIT: ...
18
votes
1answer
6k views

How can I change the font family in pgfplots?

I am using the classicthesis package in LyX to typeset my thesis. I have a plot produced with pgfplots. It uses math fonts same as elsewhere in the text, which is inconsistent with other plots of mine ...
11
votes
2answers
535 views

TikZ: Use --cycle in circuits

Why does the --cycle command doesn’t work in a circuit drawn with the TikZ library circuits.ee.IEC? The problem with manually draw the last connection is that the ends are not joined. I made the ...
12
votes
1answer
1k views

putting a tikzpicture inside a \caption{}

I'm attempting to put a small tikzpicture inside a \caption{} belonging to a figure environment. The reason for doing this is fairly simple - to create an in-caption legend for a PGFplot, with ...
5
votes
1answer
423 views

TikZ example involving Spies won't typeset properly using XeLaTeX

The example in this answer, illustrating the use of "spies" using the Tikz package, fails to typeset correctly when using XeLaTeX: the magnification circle appears empty. Using pdfLaTeX and LaTeXmk ...
3
votes
0answers
189 views

Directed hyper-edges in tikz [duplicate]

Possible Duplicate: Arc between arrows in TikZ (automata library) Can anyone tell me if and how I can draw directed hyper-edges in tikz? Specifically, I'm trying to get an edge starting at ...