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.
6
votes
1answer
436 views
TikZ borders showing through when they shouldn't (overlapping circles)
If you draw two circles that are exactly the same in all aspects (location, size, etc...) except they have different colors, then the "border" of the underlying circle is showing through.
...
33
votes
3answers
2k views
3-dimensional histogram in pgfplots
I have a simple 3d histogram
which I want to import into pgfplots, e.g. using matlab2tikz or by hand.
PGFplots does not offer 3d histograms.
Is there an easy way to do this?
32
votes
3answers
6k views
Drawing Mechanical Systems in LaTeX
I really like CircuiTikZ for drawing diagrams in my LaTeX documents. However I mostly draw mechanical and not electronic systems, which is why I'm looking for some similar way to draw mechanical ...
23
votes
2answers
635 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 ...
19
votes
1answer
3k views
Simplest way to overlay a text + rectangle label an image?
For my figures thus far I've been using LaTeX's straightforward figure code, i.e.:
\begin{figure}
\centering
\includegraphics[width=6.5in]{figure.png}
\caption[Stuff here]{(A) More stuff ...
7
votes
1answer
5k 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 ...
26
votes
2answers
1k views
Drawing heatmaps using TikZ
Introduction
I want to create a heatmap using TikZ.
You can see the basic idea in the picture below:
I basically have a table of values and each value is assigned a color.
The picture is the result ...
18
votes
3answers
798 views
Letterpress effect through PSTricks or Tikz
I have already typed in the META section of the website a post addressing the question as to how the letterpress (or engraving-like) effect in the headers of the site had been achieved. I know it can ...
10
votes
2answers
831 views
How can I draw a Karnaugh map
Can you please help me drawing the kmap as shown in the link.
A sample of the circles around the 1's is sufficient.
*Edit**
I made the following code. Can you help me now in completing this ...
10
votes
2answers
633 views
Issues and potentiality of the tikzmark macro: dynamic box adaptation
Since I discovered the tikzmark macro I've been enthusiastic about it.
I think that it is possible to distinguish at least two versions of the command:
a basic one (two examples: ...
12
votes
5answers
1k views
Creating a node fitting the horizontal width of two other nodes
I have the two PGF nodes foo and bar positioned in a row.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[node ...
10
votes
3answers
286 views
Macro to access a specific member of a list
I want to be able to have a macro access a specific element of a list. The following code works, however requires me to have two separate macros: one that accepts a list, and the other that accepts ...
7
votes
2answers
1k views
Centering a TikZ picture around an area
I often find myself in the following situation: A tikzpicture of mine consists of a main area and some outer material like text labels which are hardly symmetric around the main area. If such a ...
19
votes
3answers
2k 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 ...
7
votes
1answer
341 views
Is there something like \providetikzstyle similar to \providecommand?
I have standalone figures that I include in my document. These figures use statements like \providecommand{\HypotenuseLabel}{$h$} which allows the figure to have a default label, and which can be over ...
6
votes
3answers
621 views
use of tikzpicture matrix in align or gather environment
So far I have found using the matrix command in the TikZ package is the only way of drawing a T-shape around the bottom row and middle column of entries in a matrix. I now need to use this matrix in ...
18
votes
2answers
1k views
Axis break in pgfplots
Is there an easy way to 'break' the axis in a pgfplots environment? What I'm talking about is something like this
Any minimal plot will do as an example...for example
\documentclass{minimal}
...
17
votes
2answers
2k views
Problems with TikZ calculations
When can I use functions and do calculations in TikZ?
How do I make this work:
\draw (0,0) arc(0:90:sqrt(15)); %not ok
why is this working:
\draw (0,0) arc(0:asin(1):5); %ok
with ...
16
votes
2answers
1k views
How can I work around this TikZ bug?
I have some files with TikZ graphics that have suddenly changed appearance since I upgraded to PGF-2.10. Here is a minimal example:
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
...
6
votes
4answers
4k views
Windows API error 5: “Access is denied” when trying to compile TikZ picture
I installed PGF but are unable to compile the following document:
\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) --(1,2);
\end{tikzpicture}
...
46
votes
10answers
8k views
List of available TikZ libraries with a short introduction
Quick links:
Summary
❧ Intersections library
❧ Arrow tips library
❧ Calc library
❧ Mindmap Library
❧ Shapes library
❧ Paper Folding Library
❧ Chains Library
❧ Shapes library
Very often I ...
40
votes
2answers
7k 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 ...
29
votes
6answers
1k views
Creating gears in TikZ
I am trying to create a gear in TikZ in which the number of spikes can be determined and the size as well. I was looking through the pgfmanual and stumbled upon the decorations section and I tried a ...
21
votes
8answers
4k 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:
...
17
votes
1answer
2k views
Global variables for all tikz drawings in a document
Sorry if this question sounds too elementary. I am new to TikZ, although I have experience with LaTeX.
Say I have multiple TikZ statements in a LaTeX document like the following:
\tikz\draw[line ...
28
votes
2answers
2k views
Dimensioning of a technical drawing in TikZ
Is there is an easy way to mark dimensions in a technical drawing with TikZ?
Is there a library or something?
Edit
I am using xelatex.
Update
I chose Martin's answer because it serves me well for ...
23
votes
1answer
4k views
Bell Curve/Gaussian Function in TikZ/PGF
Can anyone tell me how to plot a gaussian function/bell curve using TikZ/PGF? I'm basically looking to implement something like PSTricks's \psGauss command.
18
votes
1answer
714 views
Explanatory bubbles in beamer
In the MWE below I want to place an "explanatory bubble" (see picture inserted below) pointing to the word "Integer" in the 8th line (the bubble should superimpose the text, a transparency effect such ...
9
votes
3answers
4k views
Example of fancy table using TikZ package
Can anyone share me several fancy table templates? I want to make this thread like a reference so that each time I need a template, I could just go here. If you can, please provide a screenshot for ...
22
votes
5answers
1k 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 ...
21
votes
6answers
1k 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 ...
18
votes
3answers
4k views
3D bodies in TikZ
Is there like a library that has default geometric figures like the ones shown below. Am not acquainted yet with 3D diagrams in TikZ.
14
votes
3answers
1k views
How to draw text-anchored tikz line below text instead of above?
I wish to mark several pairs of from/to anchor locations in text, and use tikz to draw lines between these. The anchors are not in absolute page locations; the text determines where the endpoints of ...
17
votes
4answers
1k views
How to generate all possible Venn diagrams (with the case below) efficiently?
I can draw Venn diagrams but now my question is more complicated than just drawing Venn diagrams one by one. I need to draw all possible Venn diagrams efficiently. I need a combinatorical approach ...
19
votes
4answers
799 views
How to draw a Catalan number diagram on TikZ
This is a very easy question, but I am a LaTeX newbie. Any idea how to code diagrams of this kind?
Image taken from the Catalan number Wikipedia page.
17
votes
2answers
452 views
Tikz: purely vertical arrow from nodeA.south to nodeB.north
I have the following tikz code
% compilation command: pdflatex --jobname=Diag-f1 Diag.tex
\documentclass{book}
\usepackage{tikz}
\pgfrealjobname{Diag}
\begin{document}
\beginpgfgraphicnamed{Diag-f1}
...
18
votes
3answers
2k 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?
12
votes
2answers
984 views
Strange arrow mark with TikZ edge and anchors.
When I draw an edge between two nodes with anchors and globally set option [->], I get an additional arrow tip symbol at the beginning of the last edge in the path. For example in
...
16
votes
2answers
2k views
14
votes
2answers
699 views
Tikz-PGF: Draw integral test plot
So I'm doing a report on convergence tests in LaTeX, and would like to produce a diagram demonstrating the integral test for convergence. I am somewhat new to LaTeX, and a total n00b when it comes to ...
19
votes
3answers
739 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 ...
14
votes
2answers
1k views
Pascal's triangle in tikz
I would like to typeset the top part of Pascal's triangle. To get the triangle with the names of the binomial coefficients, i.e., {n \choose k}, I used the following code
\begin{tikzpicture}
\foreach ...
9
votes
3answers
847 views
Drawing different tikz shapes parameterized by data from a file
I have a file with three columns of data, x, y, r.
# x y r
1 1 0.1
2 2 0.5
3 3 1.2
and so on. I'd like to loop over the rows, and draw a circle at x,y with radius r for each row.
I first thought ...
7
votes
3answers
6k views
Beamer vs. TikZ: uncover nodes step-by-step
I'm trying to uncover a TikZ image piece-by-piece like so:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{frame}{Linearity}
\begin{center}
...
4
votes
2answers
341 views
Package PGF Math Error: Unknown operator `o' or `of'
I am getting a weird error while trying to place a node above another node using the below= syntax.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[] (node1) at ...
4
votes
1answer
788 views
How to typeset a TikZ picture inside a node?
The contents of a node are drawn in text mode. Is there a way, short of introducing a tikzpicture environment, to draw a picture inside a node?
Nesting tikzpicture environments is problematic, also ...
14
votes
3answers
3k views
In TikZ, is it possible to nest nodes?
My use case: I am drawing chemical schemes. Each molecule contains several nodes. However, I also want to put each molecule into a "wrapper" node, so that I can use the usual anchors in combining ...
8
votes
2answers
247 views
How to draw multiple Rectangles from input data file
I want to draw set of rectangles on axis based on input file. My .tex file should be some thing like that
\documentclass{article}
\usepackage{tikz,pgf}
\usetikzlibrary{plotmarks}
...
6
votes
4answers
2k views
Diagonal strikeout starting too low and ending too high
I want to strikeout an equation with diagonal line but I've not managed to get the diagonal line to draw as I want. The closest I've gotten is via the first example in Frédéric's answer of \cancel ...
4
votes
5answers
2k views
How do I use pgfmathdeclarefunction to create define a new pgf function?
I'd like to define new function for pgf so I can use it in pgfplots. I'm trying to create a unit pulse function p(x) which has a value of 1 from x=0 to x=1, and 0 elsewhere.
I read the pgf manual on ...
