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)

29
votes
3answers
2k views

Creating playing cards using TikZ

I'm creating a card game, specifically a computer science Fluxx variant, and want to generate the cards through *TeX. They should look like this: In some of them I want to put some graphics or ...
29
votes
4answers
6k 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 ...
29
votes
2answers
997 views

Draw 3D intersecting surfaces

Problem This is a shameless "just do it for me" graphics question, but honestly I have no idea where to start. I'd like to reproduce this figure The image shows the intersection of two ...
29
votes
1answer
14k views

Export eps figures from TikZ

Section 32 Externalization Library of the pgfmanual (v2.10) explains how to generate PDF figures and EPS figures. I successfully tried it with PDF output (there is an example with a full explanation ...
29
votes
1answer
1k views

Creating thicker Tikz mindmap connectors

I'm running MiKTeX 2.9, on a Windows 7 machine. My pdflatex compilation log lists: pgf 2008/01/15 v2.10 (rcs-revision 1.12) I am using TikZ's mindmap library to draw some graphics and I quite ...
28
votes
4answers
2k views

Draw somewhat random function

I am trying to reconstruct this image here I am not very happy with the code, as it uses hacking and adding white boxes and alike. My problem is now how do I draw the somewhat arbitary function in ...
28
votes
2answers
2k views

How to draw Brownian motions in tikz/pgf

Here I want to draw some Brownian motions in tikz, like this: Furthermore, I want to truncate the trajectory of Brownian motion, like this: I have tried many times with random functions in tikz, ...
28
votes
3answers
2k views

How can I draw nucleosomes with wrapped DNA in tikz or pstricks?

The nucleosome is the fundamental unit of DNA packing in cells, and I am trying to generate some figures for regular use in manuscripts and presentations. The nucleosome is commonly abstracted to a ...
28
votes
5answers
3k views

How to draw the region of inequality?

Everyone, I would like to draw the region \begin{align*} x_1 + x_2 &\ge 3 \\ 2x_1 - x_2 &\le 5 \\ -x_1 + 2x_2 &\le 3 \end{align*} Here is my code to draw the region of inequality: ...
28
votes
2answers
3k views

Stroke with variable thickness

Can you create lines with variable thickness (line width) in Tikz?
28
votes
1answer
792 views

Polar histograms

I recently stumbled upon this post, that explains how to make polar histogramms with R. An improved version of R-package can be found here. Even though it looks unfamiliar, the result of is quite nice ...
28
votes
2answers
895 views

3D solids with Tikz - or an alternative?

I want to draw 3D shapes in latex. I have tried out different strategies, but nothing has led me to a good solution yet. First what I want to do, then what I have done so far. In prioritized order, ...
27
votes
6answers
1k views

Design of an asteroid belt in TikZ

How can I construct an asteroid belt in TikZ? That is my question: I get everything right, but I do not know how to make the asteroid belt. I have no code to add besides the preamble with TikZ ...
27
votes
2answers
4k views

Draw a bivariate normal distribution in TikZ

For a small class I want to draw a bivariate normal distribution and show where the means from the two variables meet in the space. Has anyone done this in TikZ?
27
votes
4answers
5k views

How to draw arrows between parts of an equation to show the Math Distributive Property (Multiplication)?

there is a part of my paper where I use the distributive property and it's not that clear for the reader to see (I'm using in proposional logic for a proof). The logic equation (part of) is: (l_{1}) ...
27
votes
4answers
1k views

Saturn rings with TikZ

The planet and a ring are easily drawn. The challenge is to layer them in such a way that the far side of the ring is hidden from view behind the planet, and the near side of the ring eclipses the ...
27
votes
3answers
5k views

Using TikZ, how to draw an elliptical arc starting from point A to point B with the origin as its center where both radii are given?

I am new to TikZ and reading its manual now. For the sake of exercises, I want to draw Batman's logo as follows: Using TikZ, how to draw an elliptical arc starting from point A to point B with the ...
27
votes
5answers
3k views

How can I fix jumping TikZ pictures in beamer?

The problem of stuff jumping in beamer is a common one, (see e.g. Avoiding jumping frames in beamer) and we've seen it here from time to time (I imagine the "related" list at the side will be quite ...
27
votes
4answers
5k views

How to place a node in the middle of an arc?

I think it is a simple question, but I didn't find the answer yet. The code I'm using is the following: \draw[->](1,0) arc(0:-30:1) node[midway]{$30$}; But in this way the node is placed at the ...
27
votes
2answers
5k views

Unknown error using tikz matrix of nodes in beamer

I am having trouble getting a basic example of a matrix of notes to show up in my beamer presentation. I am using the code copied from the pgf manual. Here is a complete working example. The error I ...
27
votes
3answers
2k views

Arrow with two colors with TikZ

I want to create with TikZ a yellow arrow with black margin (border, edge). I thought I could do this by using two arrows which lie on the top of each other, e.g. with: \documentclass[12pt,twoside, ...
27
votes
6answers
4k views

What's the easiest way to draw the arc defined by three points in TikZ?

An ordered set of three points uniquely defines a circular arc, and I'd like to be able to draw that arc in TikZ. I know about the arc drawing command, which does the job given a radius, two angles, ...
27
votes
4answers
17k views

Define a variable in TikZ

I guess this is a very simple question, but I couldn't find the answer... How can I define a variable in TikZ? I want to have something like, for example: \draw[->] (x1,y1)--(x2,y2); Such that ...
27
votes
2answers
4k views

TikZ rectangular node with different rounded corners

This is my minimal example: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[rounded corners=3pt, draw, fill=red!20]{Hallo!}; \end{tikzpicture} ...
27
votes
3answers
23k views

Tikz: Multi-line text in the node description [duplicate]

I use tikz to create pictures in latex. My picture consists of set of nodes. Every node has its own text inside the node, for example, "This node is valuable": \node (mynode) [mystyle,right=of ...
27
votes
4answers
10k views

Node shapes in TikZ

I want to draw a block diagram for a software app and I need two shapes which I couldn't find on the Internet. The shapes are a parallelogram and a rectangle with double side margins. One is for data ...
27
votes
2answers
417 views

Align nodes containing numbers on the decimal separators

In a plot, I have several vertically distributed nodes containing numbers with different numbers of digits before and after the decimal separator, and a trailing percent sign. I would like to align ...
27
votes
4answers
6k views

Script to automate externalizing TikZ graphics

Is there a script to automate externalizing TikZ graphics? (As suggested by Scott here)
27
votes
1answer
11k views

How to set default style for arrow tips in TikZ?

I am creating multiple TikZ pictures within one document and would like to set the default style of arrow heads for all the pictures to the latex style, i.e. like -latex does, so that I don't have to ...
27
votes
2answers
1k views

How can I create new commands in TikZ?

I am new to the use of TikZ. I have been evaluating the TikZ-KTikZ combination, over the last 2 days, as an alternative to Xfig, which I have used for 17 years. I have managed to create a grid ...
27
votes
1answer
952 views

How to add a regression line to randomly generated points using pgfplots in Tikz?

\documentclass{article} \usepackage{tikz} \usepackage{color} \usepackage[active,pdftex,tightpage]{preview} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture} ...
27
votes
1answer
5k views

How to draw a decorated rectangle with rounded corners?

As the title says, I was trying to draw a rectangle with rounded corners, and then decided it needed decorating. Well, the result looks awesome, but isn't really what I had in mind. a) What happened? ...
26
votes
3answers
1k views

padded boundary of convex hull

I'm trying to draw a boundary around a convex set of circular nodes in TikZ. The aim is to have it padded by 1cm, with an arc at the corners between segments, like this: I currently have the ...
26
votes
2answers
1k views

Drawing a flag with TikZ

I am trying to create a flag in TikZ but aesthetically it's not the best. Here is my MWE: \documentclass[letterpaper]{article} \usepackage{fullpage} %\usepackage{amsmath,amssymb,amsthm} ...
26
votes
5answers
3k views

How to draw tangent line of an arbitrary point on a path in TikZ

Suppose I specify some node as occurring at some point on a path. Say for example the node (P) defined on the following path. \path[draw] (0,9) to[out=-90,in=180] (9,0) node[pos=0.7,circle] (P) {}; ...
26
votes
4answers
2k views

Fill of a thermometer

The objective here is to create a fill of the thermometer to a desired degree being this in Celsius or Fahrenheit. Of course optimizations in the code below are welcomed like how I create the labels ...
26
votes
3answers
15k views

Tikz - How to Draw Boxes Around Set of Nodes

How to draw the boxes as shown in the attached image? I could only manage to draw the chart but could not highlight the desired node / nodes with a rectangle box. Preferably dotted. I could not draw ...
26
votes
3answers
4k views

Drawing random paths in TikZ

I am looking for a way to draw with TikZ something that looks like a random path. Here is an inspiration: Is it possible to have TikZ generate something that would be similar to a random path ...
26
votes
3answers
6k views

Using math in TikZ

I know it has been asked and answered before, and I need to put { and } around it, but for some reason this doesn't work: \draw (0,0) -- ({atan(1)}:{sqrt(2)}); Any idea why?
26
votes
2answers
2k views

Milestone graphic in TikZ

This question led to a new project for a TikZ based solution: timeline The author of the original artwork has posted his METAPOST based library: blueprint How could I implement a ...
26
votes
2answers
2k views

Making a Calendar for TUG

This question is triggered by a post from Peter Wilson in comp.text.tex`. Peter wrote: TUG members produced a calendar for 2012 and, if I remember correctly, for some previous years as well. I really ...
26
votes
2answers
967 views

Arguments for TikZ style

Motivation To put arrows inside of a TikZ path I have defined myself a TikZ style arrow inside. To make it even more portable I want it to take arguments like this \draw[arrow inside={pos = 0.1, end ...
26
votes
1answer
4k views

Transparent node with opaque text?

Is there a simple way to create a transparent node with opaque text? Preferably without having to use a postaction or redraw the node. In the example below I'd like to achieve the effect of the first ...
26
votes
2answers
710 views

Chaotic billiard with TikZ

I'm looking for a TikZ library that could help me to represent different shapes of chaotic billiards. Any idea?
26
votes
3answers
2k views

Parametrize shading in table through TikZ

I wanted to do some shading in a table according to its values. For example, if you see the table below: a b c d a 90 10 0 0 b 0 80 10 10 c 0 0 95 5 d 0 10 5 85 I want to ...
26
votes
3answers
1k views

Properly aligning drawn lines between the corners of 2 rectangular nodes in TikZ?

When I draw a thick line from the corner of one box to the same corner of another, it doesn't attach properly. See the code and picture below: \documentclass[a4paper, 11pt]{article} ...
26
votes
2answers
2k views

Mouseover events in beamer: hovering on \eqref and a comment containing the original equation popping up

This idea came into my mind while I was listening to a speaker presenting his results in a seminar, he used lots of equation references in his later slides, however I can't remember which equation he ...
26
votes
1answer
891 views

Join the dots - Hannukah

The festive season is upon us and we all of course bring out our favourite TikZ Hannukah Menorahs to celebrate. However, our children are still not satisfied and demand an activity to do during the ...
26
votes
3answers
2k views

Applying a postaction to every path in TikZ

Sometime, for example in a solution to a recent question, one wants to apply a postaction (like a decoration) to a group of paths. A naive solution is to use every path/.style={}. Unfortunately this ...
26
votes
1answer
566 views

TikZ 3.0.0 and Hobby

Compiling the following MWE: \documentclass[tikz,border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{hobby} \begin{document} \begin{tikzpicture} \draw[help lines] (0,0) grid[step=0.25] ...