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)

10
votes
2answers
838 views

Problem with overlay when a tikzpicture is inside another tikzpicture

update i discovered lately this question where Nickolay Kolev uses \tikz inside a tikzpicture environment. A lot of users think that is a wrong practice and I agree that is very strange but sometimes ...
9
votes
1answer
152 views

Measuring align

From what I read it seems that align environments are processed twice: the first time for measuring, the second time for actual typesetting. My question is whether one can get access to these ...
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
2answers
1k 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 ...
34
votes
3answers
8k views

Pgfplots: how to fill the area under a curve with oblique lines (hatching) as a pattern?

I want to hatch the area under a curve (graph of a function) with oblique lines on an interval (to illustrate the function's integral on that interval). This can be done elegantly in gnuplot... ...
13
votes
2answers
7k views

Plotting bell shaped curve in TikZ-PGF

I want to create some bell shaped curves for demonstrating hypothesis testing in statistics. Can anybody help me drawing curves like shown in the following picture?
15
votes
3answers
2k 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 ...
23
votes
2answers
513 views

Is there a TikZ equivalent to the PSTricks \ncbar command?

Although I now use TikZ, every so often I find myself looking for very useful PSTricks commands which don't seem to exist in TikZ. The pst-node package has an \ncbar command which allows one to ...
16
votes
4answers
825 views

How can I draw a TikZ element multiple times against a shaded background?

If I have two tikzpictures drawn: \documentclass{article} \usepackage[margin = 1in]{geometry} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing,calc,shapes,shapes.geometric,patterns} ...
18
votes
2answers
2k 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 ...
23
votes
3answers
1k views

How can I work around this TikZ bug: (\x)^2 and \x^2 produce different results in TikZ plot?

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} ...
45
votes
10answers
9k views

How can I speed up LaTeX compilation?

The slowest part is a dozen of diagrams in TikZ.
44
votes
4answers
5k 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?
41
votes
5answers
3k views

3D helix torus with hidden lines

How can I generate the above image using TikZ (possibly other methods will work if they produce better looking results)? I would like to have a nicely shaded (not so dark image) without gridlines ...
34
votes
1answer
1k views

Hobby path realization in convex hull approach

Motivation In the answer Highlight a group of nodes in a tikz tree, Jake suggested combining the convex hull approach from padded boundary of convex hull with the hobby path and I was really ...
16
votes
5answers
2k 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 ...
21
votes
3answers
4k views

How can I set the TikZ label anchor explicitly?

I want to add a label to a node, but "inside" the node. Something like this: The manual seems to indicate it might be possible, although no actual key is named. The ... anchor point for 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 ...
24
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 ...
13
votes
4answers
621 views

tikz declare function and babel french option

I would like to declare functions in tikz for multiple uses of the same function within the code. Sadly, it seems that the tikz "declare function" is not compatible with the french option in babel. ...
17
votes
2answers
4k views

Is plotting exponential graphs a known source of bugs in TikZ?

I want to plot $y = 2^x$ over a small domain. Unfortunately, even though tikz (v 2.1) seems to be able to calculate 2^{negative numbers} it is not plotting them correctly. My minimal example is: ...
226
votes
2answers
25k views

Create xkcd style diagram in TeX

The unique style of the diagrams at xkcd has an informative but nice hand-drawn touch. I guess they are actually drawn by hand but just recently on our partner site for Mathematica someone asked how ...
73
votes
6answers
3k views

What is the minimum one needs to know to use TikZ?

I am fed up with the poor quality of the pictures in the papers written by my graduate students and am trying to convince them to use TikZ. I know of three ways to begin learning TikZ: The TikZ ...
56
votes
5answers
7k views

How can I create a pdf document exactly as big as my tikz picture?

I often create pictures in tikz that I want to either send to someone, or include in an email. The problem with that is that there is a big white space around and and especially below my pictures. To ...
83
votes
10answers
5k views

How can I draw an egg using TikZ?

I would like to draw an egg-format element, but I have only found ways of drawing ellipses.
60
votes
6answers
2k views

Curve through a sequence of points with Metapost and TikZ

This question led to a new package: hobby I found Metapost best for drawing complex smooth curves (i.e., Bezier, splines), since you do not have to directly specify Bezier control points. ...
43
votes
5answers
13k views

What You See is What You Get (WYSIWYG) for PGF/TikZ?

Are there any WYSIWYG editors for PGF/TikZ? Perhaps something similar to LyX but for PGF/TikZ? If there is no WYSIWYG editor for this tandem, is there one perhaps that allows the user to easily ...
29
votes
6answers
9k views

What is the easiest way to draw 3D cube with TikZ?

I'm trying to find the easiest way to draw a 3D cube (it's for my UML diagram) with TikZ. Could you please give an example? Like this:
41
votes
2answers
16k views

Draw Curly Braces in TikZ

I am using TikZ with the following code to draw a picture. How can I turn the curly bracket next to $P_2$ to the right? \documentclass{article} \usepackage{tikz} ...
39
votes
3answers
4k 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 ...
25
votes
2answers
3k 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} ...
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?
24
votes
4answers
5k views

Faded drop-shadow using tikz-based rounded rectangle?

Background Epigraphs are in a box with rounded corners. The boxes have a drop-shadow. Example Picture #1 shows a shadow, while Picture #2 shows a shadow that fades out (soft blur): Problem ...
18
votes
2answers
909 views

High level digital design in TikZ

I am very new to TikZ and I have trouble making a diagram similar to the one here: My problems are specifically making MUX to get to inputs which would be on 1/3 and 2/3 of the width. Taking sigma ...
19
votes
2answers
1k 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} ...
17
votes
4answers
2k 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 ...
21
votes
3answers
1k 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 ...
17
votes
2answers
2k 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 ...
14
votes
1answer
5k views

Absolute positioning in beamer

It's easy to absolute position something using remember picture with TikZ, but it only works with pdfLaTeX. I can get something working by using negative vskip and hskips (trial and error), but that ...
19
votes
3answers
909 views

Tikz: joining points on a circle

I have the following figure I would like to draw portions of circles between some of the red points. More explicitly, I would like to go from ac1 to ab1 and then to ac2 following circle A, then go ...
9
votes
1answer
1k views

Is it possible to change the color of a single bar when the bar plot is based on symbolic values?

I am beginner in LaTeX, trying to use it for industrial documents. I wonder if there is a way to change the color of only one bar of the plot below, ie "TestDetails", to illustrate it is a local macro ...
14
votes
1answer
947 views

Drawing relationships between elements of a database

I am looking into a feasible way of drawing relationships between Elements from a database. An example: Element x is related to Element Y via the Role "sister". Relationships exist in the form 1:1, ...
12
votes
2answers
2k views

Problem with defining shortcuts for TikZ matrices.

For answering a question yesterday I wanted to define a shortcut for creating a matrix inside a tikzpicture. As a minimal example, consider \newcommand\mymatrix[1]{ \begin{tikzpicture} ...
10
votes
7answers
15k 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} ...
17
votes
5answers
2k views

How can I force TikZ pin angle?

I'm trying to draw a resultant force diagram like so: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (0,0) -- (90:2.7) -- ++ (-13:12) ...
9
votes
3answers
446 views

How to draw a return arrow from node-3 to node-1

Say I have a code to draw a flow chart, I want now a arrow from node 3 to node 1, how can I do that? 1<--| | | 2 | | | 3---- MWE \documentclass[class=article,border=0pt]{standalone} ...
6
votes
1answer
869 views

How to redefine \lstinline to automatically highlight or draw frames around all inline code snippets?

How to redefine \lstinline to automatically highlight or draw frames around all inline code snippets? E.g. using \bh and \eh commands from Highlight text in code listing while also keeping syntax ...
6
votes
1answer
573 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. ...
38
votes
5answers
7k views

How can I use TikZ to make standalone (SVG) graphics?

I would like to use TikZ in other settings than TeX and I'd especially like to use the drawings on websites where the text should be searchable and selectable. However, I'm unsure of the best way to ...
41
votes
2answers
6k views

Design a custom Beamer theme from scratch

No matter how hard I search, I cannot find any information on creating a Beamer theme from scratch, as opposed to LEGOing it together from the built-in inner, outer and color themes, maybe modifying ...