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)

28
votes
1answer
702 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
640 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
6answers
6k views

Why draw diagrams using LaTeX when there are open source tools like OpenOffice?

I was looking at recent questions here and was surprized that people were drawing diagrams in LaTeX, when it can be done in SmartDraw, OpenOffice or other programs. Is there any benefit to using LaTeX ...
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
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, ...
27
votes
5answers
2k 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
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
5answers
2k 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: ...
27
votes
6answers
3k 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
9k views

How to draw a line passing through a point and perpendicular to another?

I'm having a bit of a headache right now as I can't draw this basic figure: A straight line goes through points A and B. Another line is perpendicular to AB and goes through an arbitrary point P. I ...
27
votes
4answers
15k 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
3k views

Stroke with variable thickness

Can you create lines with variable thickness (line width) in Tikz?
27
votes
4answers
9k 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
397 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
5k views

Script to automate externalizing TikZ graphics

Is there a script to automate externalizing TikZ graphics? (As suggested by Scott here)
27
votes
2answers
786 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 ...
27
votes
1answer
12k 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 ...
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? ...
27
votes
0answers
348 views

PDF/A compatibility with TikZ

When a LaTeX document contains TikZ figures with color gradients, it seems that Acrobat Pro's preflight function can no longer convert the PDF to comply with the PDF/A-1b standard. For instance, the ...
26
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?
26
votes
4answers
4k 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}) ...
26
votes
2answers
957 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
4answers
1k 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
25k views

How to specify a fill color in RGB format in a node in tikzpicture?

I am just trying to get a rounded corner box with some text in it. The text color will be white and the box will be filled with a particular color. The preamble includes: \usepackage{tikz} ...
26
votes
4answers
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
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
5k 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

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
3answers
20k 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 ...
26
votes
2answers
661 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
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 ...
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
745 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
1answer
809 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} ...
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
495 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] ...
26
votes
1answer
1k views

Puzzle: How to compute Bringhurst's page style with TeX/Metapost/TikZ etc

In his book The Elements of Typographic Style, Bringhurst presents a hexagonal pattern for geometrically constructing the elements of the page layout. Question: Can the dimensions be simply extracted ...
26
votes
1answer
1k views

TikZ: drawing 3 intersecting circles and shading

How can I draw the three intersection circles/ellipse with that shading paradigm (not necessarily the same colors) effectively? It appears that the original image doesn't have overlapping colors ...
25
votes
9answers
6k views

Drawing polyhedra using TikZ with semi-transparent and shading effect

I would like to draw an Octahedron using TikZ, I found nowhere to start, I tried drawing 6 points and then connecting them properly, but this method gives no 3D feel at all, this is my drawing: ...
25
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 ...
25
votes
7answers
1k views

Can TikZ create pixel art images?

Can you create images like this: when you have something like 0 = green (#54ff00) 1 = white (#ffffff) 2 = red (#ff0000) 3 = blue (#0048ff) Image (Python list of integers defined above): ...
25
votes
3answers
4k views

How to design a 3D donut pie chart with pgf-plot?

It seems that pgfplots users don't like pie charts but sometimes we can't go without (for some reasons). So I was wondering if there was a way to make what is called a donut chart. For example one ...
25
votes
6answers
2k views

Are there examples written in PSTricks and they cannot be done using TikZ?

I am comparing the cores of PSTricks with TikZ and their capabilities. I am not considering whether or not a library has been implemented. Are there examples written in PSTricks and they cannot be ...
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 ...
25
votes
3answers
13k 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 ...
25
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 ...
25
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, ...