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)

11
votes
1answer
1k views

Possible to combine “…” and “x/y” in TikZ's foreach?

I'll start with a simple, minimal non-working example: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x/\y in {1/20,2/18,...,10/2} \node at (\x,0) {\y}; ...
7
votes
3answers
883 views

Wrong line spacing when changing the font size inside of a rectangle

i'm trying to change the font size inside of a rectangle and always the line space between the last and the second last line is getting wrong. How can that be fixed? \documentclass[]{article} ...
7
votes
2answers
407 views

Axis background has missing draw/stroke

I want to draw a rectangle around an axis created using pgfplots. This is a minimal example: \documentclass{minimal} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
4
votes
1answer
1k views

Placing a triangle around nodes in a tree

I have a tree filled with numbers and I want to mark a subtree by drawing a triangle around it. I can't seem to get it working. My attempt: \documentclass{article} \usepackage{tikz} ...
19
votes
2answers
3k views

Draw a prism in TikZ or PSTricks

Is there a way to define an polygon in plane and output an (orthogonal) prism with that polygon as its base? The prism should be drawn in 3D in parallel oblique perspective with controllable height h, ...
17
votes
5answers
2k views

Matching arrowheads in TikZ with math mode arrowheads

TikZ is great at drawing diagrams but there is one feature which I find quite annoying and that's the fact that the default arrowhead provided by TikZ does not necessarily respect the math mode in ...
5
votes
2answers
2k views

How to set lines, arrows and text in this block diagram on tikz?

Im quite new learning tikz, it rocks!. Well, Im trying to get the following block diagram working, but having kinda trouble: And this is what I got so far: \documentclass[12pt,a4paper]{article} ...
9
votes
1answer
2k views

Drawing grid with random color in TikZ

I'm trying to draw a 10x10 grid in TikZ like so: \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[scale=1] \foreach \y in {0.05,0.15,...,0.95} ...
4
votes
1answer
847 views

tikz-timing: text labels in symbols other than D, and time axis discontinuities

This is (more-less) two (or more) questions in one - however related; so I'll try to cover all in one post. I have a specific timing diagram layout in mind, and I'm almost there: The complete code ...
2
votes
1answer
454 views

Intersection between line and circle (tkz-euclide)

Now once, again I am trying to reconstruct one of these odd images in tikz. Now, what is supposed to show, is only the triangle, the angle, and the line CD. My attempt to do this is shown below ...
5
votes
2answers
1k views

Rotate a node but not its content: the case of the ellipse decoration

What I want to do: Draw a node decorated with bumps, but with the decoration starting from the right (ie, opposite to the usual) of the node. Why I want to do it: I will have a node hiding the part ...
2
votes
1answer
3k views

Can't find TikZ library calc

I am using a Mac operating system and am not a sophisticated programmer. I am trying to run code that uses the line \usetikzlibrary{calc} but I keep getting the error "I can't find file ...
14
votes
1answer
14k views

Typesetting a directed, weighted graph with TikZ

I just started doing things with TikZ today and I run into a problem: there is just no example code snippets for typesetting directed, weighted graphs. Can anyone supply one simple example in an ...
4
votes
1answer
2k views

Voltage sign convention (European vs. American) in Circuitikz

This time I dive into Circuitikz. Anyway, I've got a problem with the american and european styles of e.g. voltages. IIRC Voltage drops are counted positive which means the voltage arrow in the ...
11
votes
4answers
1k views

TikZ: complicated paths, e.g. for complex integrals

I would like to illustrate lecture notes on complex analysis, which by its nature is a lot about how the lines of integration are running through the complex plane. However, I'm having trouble finding ...
1
vote
1answer
955 views

TikZ figure always positioned at the center of a new page [closed]

I run into this rather strange problem when using TikZ with LyX 2. I have this graph programmed using TikZ, and it is supposed to follow a paragraph of text and be positioned at the top of next new ...
10
votes
1answer
410 views

Is there a polar coordinate registers in the let command?

I have seen that we ca use \x1 and \y1 to access cartesian coordinates of point register \p1 declared in let. Is there a way to access the polar coordinates (something like \a1 for the angle and \r1 ...
13
votes
2answers
897 views

TiKZ make lines connecting nodes have the same endpoints

Using the MWE below: \documentclass{standalone} \usepackage{tikz} \usepackage{tikz-qtree} \usepackage{tikz-qtree-compat} \usepackage{ textcomp } \begin{document} \begin{tikzpicture} \Tree [ .TP [ ...
12
votes
3answers
1k views

Book cover, integration multilayered equations. (Suggestions?)

I am sort of writing a compendium about integration, everyhting from basic substitutions, to contour integrals, Gamma, beta integrals and so forth. I feel that no standard frontcase suffices and I ...
8
votes
1answer
1k views

gnuplot true standalone

Finally I have decided to go PDF. I can add pictures without EPS wrapper, and do drawings with TikZ - life is good :o) But how do I use gnuplot? For consistency I would like to use the tikz terminal, ...
10
votes
1answer
772 views

Is it possible to use marking of decoration with edge?

The initial code is \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations} \usetikzlibrary{decorations.markings} \begin{document} \pgfkeys{ /pgf/decoration/.cd, pre ...
4
votes
1answer
1k views

Arrows in tikz-qtree with symbols in node names

I have a syntax tree with angle brackets to represent movement: \begin{tikzpicture} \Tree [ .TP [ .T' \node{T+verb}; [ .vP \qroof{`ana}.DP [ .v' ...
19
votes
3answers
7k views

TikZ - multi-color double circle node

How do I draw a node with a double circle shape where one circle has a different color than the other circle? A single \node[whatever] {content} would be nice!
3
votes
1answer
462 views

Automatically clipping undrawn objects in TikZ

I have used the trees package to construct my drawing, but I don't actually need the edges. So I have set the following to suppress them: \tikzstyle{edge from parent}=[] This works, but TikZ still ...
3
votes
1answer
957 views

Strange behavior in smooth pgfplot with sudden changes in the slope

I'm trying to plot some points with sudden changes in the slope. But I get some strange behavior like this: as you can see in the peaks, there is no smoothness in there. However, I think the ...
11
votes
1answer
946 views

TikZ: Expand width of each picture to given size

I create plots with pgf/TikZ, externalize them and then they will be included into another predefined LaTeX-document (which someone else will do, so I can't change anything there). That final document ...
9
votes
1answer
600 views

Reuse part of a path

This question is similar to Is there a TikZ dashed line decorator or some other way to make part of a path dashed?. What I want to draw: A node with a dashed loop, with a small node on the loop, and ...
3
votes
1answer
807 views

tikz spy with beamer overprint

In my presentation, I want to successively highlight different parts of my image using the TikZ spy library. Due to size constraints, the actual highlight is outside of the included image. Therefore, ...
12
votes
3answers
2k views

Computing in the list of a tikz foreach

If I say something along the lines of \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \def\I{2} \foreach \i in { \I+1, ..., 20 } \node at (\i,10) {+}; ...
2
votes
1answer
747 views

TikZ+beamer, referencing node outside current picture, inside overprint environment

In beamer, when I try to reference a node outside the current picture but inside an overprint-environment, like this, \documentclass[12pt]{beamer} \usepackage{tikz} \begin{document} \begin{frame} ...
2
votes
2answers
363 views

Avoiding blank line in every node (tikzpicture)

I created a box using \tikzstyle{PBox}=[rectangle, rounded corners, fill=kopfzeile!10, anchor=north, text=black, text width=\marginparwidth-2mm] ...
16
votes
1answer
547 views

highlighting some areas in a picture by making the rest of the picture transparent

In my beamer-document, I'm drawing on a picture as described in this question. I'm trying to hilight particular areas of my picture by making the rest of the picture "fade out", like this: In my ...
11
votes
1answer
789 views

TikZ calendar: stretching day list to exactly the linewidth

I'd like to create a wall calendar where the bottom of each page is a tikzpicture, stretching the list of days always to the \linewidth, as if it was justified text. How can I set a calendar style ...
13
votes
2answers
1k views

Chemistry molecular structure drawing programs

I am looking for chemical molecular drawing packages. There is mhchem which basically sets up a structure for including externally generated molecular structures. Also Chemfig, which is the ...
24
votes
3answers
9k views

Aligning subplots in a pgfplots figure

I have the following figure (a very, very stripped down version of a figure I created using matlab2tikz) My problem is that the subplots are not aligned correctly due to the fact that the y axis ...
3
votes
2answers
414 views

TikZ draw-Putting old calendar style date in left margin

I'm working on the formatting of a text book. The following picture shows the first thing I would like to do. There are two things to achieve : I would like to "draw" the date using TikZ so as to ...
7
votes
2answers
2k views

Data from file as list in \foreach in Tikz

I have data stored in files I named x.dat and y.dat. In the file are two columns and each row stands for one point. These points I plot in the beginning. But then I want some arrows from the x-points ...
25
votes
6answers
1k views

Spirograph, Continuous Rotations in TikZ or PSTricks

Spirograph-like drawings are obtained when one repeatedly draws a closed curve on a continuously rotated canvas. Is there a nice way to make spirograph drawings using TikZ or PSTricks? There is a nice ...
12
votes
2answers
443 views

TikZ: two figures corresponding to each other

Now I have not yet started making this picture, and I would like some pointers. Any method to produce the image is sufficient, alas I would prefer TikZ and perhaps tkz-euclide over asympote or ...
42
votes
4answers
13k views

pgfplots: how can I scale to text width?

This question led to a new package: tikzscale When I try to scale a plot with: width=\textwidth there is some horizontal space between the start/end of the plot and the start/end of the ...
11
votes
2answers
679 views

Fuse symbol with TikZ

I am using the circuits.ee.IEC library. However, I cannot find any fuse symbol like this: How can I define such a symbol using circuit declare symbol? It should be just combining the resistor ...
8
votes
5answers
3k views

Line segments with text in the middle in TikZ

Another exam, another image. I am trying to create the following image in TikZ Now. I am looking for some feedback on my code. I am trying to learn TikZ as fast as I can, but still I feel I am ...
11
votes
0answers
2k views

MacTeX pgfkeys/tikz package fails [closed]

the document listed below, (taken from here: texample.net) fails on my system (running MacTeX 2011) with the error: Package pgfkeys Error: I do not know the key '/tikz/drop shadow' and I am going to ...
13
votes
1answer
3k views

pgfplots and calculations; without fpu 'dimension too large', with fpu 'Illegal unit of measure (pt inserted)'

I'm trying to multiply some numbers that will end up in the legend of a plot. I can't get it to work: If I naively try \pgfmathmultiply, I get a dimension too large error, with the code in MWE 1 ...
16
votes
5answers
1k views

TikZ Grid Without Edges

I have a TikZ grid \draw[step=0.5cm,color=gray] (0,0) grid (3.5,3.5); But I'd like to draw the grid without edges, or with half of the edges cells missing, so that it appears to be a small section ...
7
votes
3answers
403 views

Global Coordinates

How can I declare coordinates in a block and access them from outside of the block? \begin{tikzpicture} \foreach \x / \y in { 1 / 3, 2 / 8, 3 / 14, }{ \coordinate (N\x) at ...
3
votes
1answer
194 views

externalization and text export for tikz and pstricks

A feature similar to what is offered in Inkscape in terms of font export in figures for subsequent pdflatex/latex use would be a great addition to tikz and pstricks I think. We would then be able to ...
23
votes
2answers
1k views

Making TikZ nodes hyperlinkable

I have a TikZ tree. Now I want to make the nodes click-able directing to relevant sections in the document (or directed to URLs). Some of the content in the nodes are not text. Is it possible to turn ...
8
votes
1answer
1k views

TikZ: vertically aligning text in nodeparts

I can't seem to vertically align text in different nodeparts of the same node. This MWE \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes} \begin{document} \begin{tikzpicture} ...
4
votes
1answer
960 views

Drawing a multiplexer with tikz

I want to draw a logical circuit with a multiplexer. Is there any symbol provided by the TikZ package? I'm using the TikZ library circuits.logic to draw logical circuit symbols. Or is there any ...