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)

5
votes
3answers
2k views

A macro of drawing a rectangle with several parameters in TikZ

I draw a kind of box in TikZ very often, so I decide to make a macro, even though I have never done it before... The aim is to draw a rectangle. 4 parameters (1, 7, 4, 8 in the figure) mean its ...
5
votes
1answer
713 views

Draw a special arc from 1 node to another in TikZ

Even though I just learned how to draw an arc, I have difficulties in drawing the arcs in the figure. Especially the arc from the second circle to the first one. If I do: \draw[bend left,->] ...
5
votes
1answer
128 views

How to specify a position of node with regard to the one of another node in TikZ

I have already defined a node l1: \node (l1) [ellipse, draw=black, fill=white!20, text=black, scale=0.8]{$l_1$}; And I would like to define another node l2 and position it with regard to l1. I know ...
6
votes
1answer
6k views

Draw an arc between 2 nodes and label it in TikZ

I have already drawn two ellipses l1 and l2, l2 is on the left below l1: \begin{tikzpicture} \node (l1) [ellipse, draw=black, fill=white!20, text=black, scale=0.8, text centered]{ $l_1$}; ...
3
votes
1answer
2k views

How to style Tikz arrow tip for state-loop?

I want to have a state-node with a loop, where the arrow tip is customized (here with -triangle 60). How do change the arrow tip a loop uses? Heres a short example. I expect the loop to have the same ...
27
votes
3answers
2k 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 ...
10
votes
1answer
8k views

Problem plotting histogram using pgfplots package

The following code plots a histogram using pgfplots. \documentclass[a4paper]{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} \centering ...
1
vote
3answers
1k views

Tikz Axis with colormap bounding box does not align with other bounding boxes

My last question here was concerning tikz-axis aligned with centered other pictures. I received a very good answer. This question is similar but extends the question by a colormap as in the given ...
6
votes
4answers
934 views

Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes

I'm trying to figure out a TiKZ-based solution to this problem involving arrows between matrix rows. To this end, I would like to at least be able to make a matrix of math nodes simulate the behaviour ...
74
votes
3answers
47k views

How to scale a tikzpicture including texts?

It seems that the scale option scales only the length of lines, but not the size of texts. For instance, 1 and true and not scaled in the following code. \begin{tikzpicture}[thick, scale=0.6] \draw ...
4
votes
1answer
3k views

Using PGF in Lyx

I just tried coping & pasting code from How to draw Venn diagrams (especially: complements) in LaTeX and I get errors ... I suppose I need to install/configure Lyx to use PGF/Tikz?
14
votes
2answers
1k views

Saving and reusing/combining paths in TikZ?

In a package using TikZ, I'm generating two paths (depending on some option values), which I now need to combine to one path that should be used for \filldraw. I found Programming in TikZ which ...
8
votes
2answers
3k views

Create a math matrix in TikZ partition lines

I want to draw a math matrix in TikZ, where I can draw helping partition lines. So far I found it pretty simple to just draw a matrix with brackets. \begin{tikzpicture} \matrix [matrix of math ...
3
votes
1answer
2k views

Using opacity in tikz and the background package

I'm trying to take a given figure, make it a little whiter and put the result in the middle of the page under the text, using the package background. \documentclass[12pt]{article} ...
7
votes
1answer
6k views

How to create a bar chart in which the y-axis is expressed in percents?

Suppose there is a chart like the following: This chart was created using the code: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
1
vote
1answer
4k views

Top-align text in a TikZ node of given size for single- and multiline case

I would like to set text in a TikZ node of maximum width and minimum height, i.e. the node cannot grow horizontally (but shrink for short text) but it can grow vertically (if the text exceeds the ...
10
votes
1answer
3k views

Calling a previously named path in tikz

Using the intersections library, we are able to name a path. For example \path[name path=line1] (0,0) -- (1,1); Now, how can I later in the picture call upon this path with the name line1 and do ...
11
votes
3answers
2k views

How to draw stack diagram with TiKz?

I want to draw a stack diagram looks like this with TiKZ. I wonder is there way to draw this diagram with automatic positioning like drawing Automaton? Any idea? Thanks in advance.
4
votes
2answers
941 views

Rescaling ticks

I have created a simple 2D plot from a table (xy-data) and now I would like to both translate and scale the x-axis. (I would prefer not to scale the actual data only the axis). As an example, let's ...
6
votes
1answer
950 views

How to fix a contour plot at top of a 3D box

I want to fix a contour plot at the top of a 3D box. The following code sets the contour plot to the base: \documentclass{scrartcl} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
6
votes
2answers
2k views

How to concatenate strings, to e.g. create commands that return lists?

I was thinking about Felix' Question, where he wanted to return lists in TikZ. My approach so far was to return the single results as individual \nodes, separated one centimeter each. Now I would like ...
3
votes
1answer
2k views

smooth surface plot with pgfplots/gnuplot

i want to create a smooth surface plot with pgf-plots and gnuplot. The following code yields a graph, but i need much more gridpoints along y-direction. How can i reach this? The increase of samples ...
4
votes
1answer
862 views

How to create lists in tikz

I would like to create lists and use them in tikz \foreach loops. Example: \newcommand{\createSquareList}[1]{ this is the part I do not know } \foreach \n in \createSquareList{5} { % do ...
10
votes
4answers
8k views

Getting TexLive installation to work

In the launchpad website it is mentioned that the version in the repositories is hopelessly outdated (by two years, even in the oncoming october release). I was trying to install TeXLive 2011 (in ...
5
votes
2answers
1k views

Change math font for figures only (including TikZ environments within figures)

In my document, I want the main text to be in the times font, and the math to be in the txfonts font. This I can do with the help of the txfonts package. However, I want everything that shows up in my ...
18
votes
4answers
4k views

TikZ labelling venn diagram

I have a 3-circle venn diagram \def\firstcircle{(0,0) circle (2cm)} \def\secondcircle{(55:2.67cm) circle (2cm)} \def\thirdcircle{(0:3cm) circle (2cm)} % Now we can draw the sets: \begin{tikzpicture} ...
1
vote
1answer
309 views

How to draw a text of several lines framed with tikz?

I am drawing a diagram with tikzpicture. The main idea is to draw several boxes of texts framed, and link them with lines... What I know is using \filldraw to draw boxes, \node to write one line of ...
3
votes
2answers
2k views

Tikz figure in Beamer shifting way to the right of the frame

I'm trying to include a tikz drawing into a Beamer slide. When I do it like this: \begin{frame} \frametitle{Overview} \input{smartservice-diagram.tex} \end{frame} the image is way too big. I ...
12
votes
1answer
5k views

Default color pgfplot

I noticed that when using pgfplots to make plots without specifying style, it automatically assigns the same color and line style to the first input and fifth input, which means the two curves would ...
5
votes
1answer
697 views

TIKZ: writing text top downwards

My simple question is how to set some text using tikz in a column e.g. +---+ | A | | B | | C | +---+ I do not want to rotate the text so I can not use the rotate option or the set text along path ...
1
vote
1answer
3k views

Pgfplots: Linewidth when using \ref in custom legend

I'm creating a custom legend for some pgfplots graph by drawing a node containing a shortstack. Inside the node I'm using \ref{} to insert correct line-styles in front of my text labels. The problem ...
4
votes
1answer
3k views

\usepackage{tikz} not working

I'm using MikTex and am trying to import the TikZ package to draw some graphics in LaTeX. When the pdf builds however it doesn't recognise the package TikZ and fails. Every other package I am using ...
27
votes
5answers
4k 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) {}; ...
12
votes
1answer
5k views

How to move a whole tikzpicture?

I have a tikzpicture, rounded by a fbox, and embedded in a minipage. Is it possible to change the position of the whole picture inside the minipage? for instance, move the picture 1 unit higher and 1 ...
4
votes
2answers
918 views

Decoration at end of line after “shorten >” command

I have a style that puts an arrow at the end of a line for me: \makeatletter \tikzset{nomorepostaction/.code={\let\tikz@postactions\pgfutil@empty}} \makeatother \tikzset{mystyle/.style={ shorten ...
9
votes
1answer
2k views

TikZ: Omit {} after \node declaration for unlabelled node?

This may seem a bit trivial, but I am writing TikZ code with an enormous number of unlabelled nodes. It frustrates me that I have to type {} at the end of every node declaration. Is there some ...
6
votes
2answers
3k views

How to modify the distance between branches when drawing trees using TiKZ?

I want to modify the distance between a parent node and a child node when drawing a tree using TiKZ package. I looked at the example at TiKZ site, and add a property called sibling distance. However, ...
6
votes
2answers
2k views

TikZ “callout” positioning problem

I have just recently upgraded my TeXLive from version 2010 to 2011 (OS versions Ubuntu 10.10/Maverick 32-bit and Windows 7/64 bit). This is pdfTeX, Version 3.1415926-2.3-1.40.12 (Web2C 2011) ...
13
votes
2answers
1k views

how to create PDF in grayscale mode or TikZ figure only?

how to create PDF in grayscale mode? convert PDF color in PDF grayscale. I need the PDF in grayscale color. Or in TikZ figure only.
17
votes
3answers
10k views

TikZ: What affects the space between nodes placed with `below of=` syntax?

How does TikZ decide how much space to put between these two nodes: \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \node (a) {A}; ...
18
votes
1answer
2k views

Nicer wavy line with TikZ

My question is inspired by Feynman Diagrams with tikz. The photon line (TikZ snake) in the answer does not look like it usually looks on a Feynman diagram: in the "reference" look, which may be ...
16
votes
1answer
22k views

How to draw a line of dots in tikz?

Instead of drawing a dashed line as follows: \draw [dashed] (10,1) -- (10,11); I would like to draw a list of dots from (10,1) to (10,11), like ........., but vertically. Could anyone tell me what ...
10
votes
4answers
539 views

Adding slurs to words in a text

Friends, I have a special case in which I need to insert slurs (music) in some words in a text. A slur is a curved line connecting notes on a score to indicate that they are to be played or sung ...
5
votes
1answer
569 views

Multiply defined label warnings when using Subcaption in a Tikz picture

In an earlier question, I asked how to create zoomed highlights of a larger image automatically. User Jake provided an excellent solution using TikZ. However, when subcaptions and hyperref are added ...
10
votes
1answer
7k views

Adding underbrace in tikz

I have this code to draw a mass on a spring and now I want to have a curly brace below the spring to denote the distance: x_0. How do I do this? \begin{tikzpicture} ...
4
votes
2answers
3k views

Attempting to export tikz to eps

So, after having read the below thread: Attempt to export eps figures from TikZ fails I am able to generate .dvi versions of my figures. However, I need .eps, and it seems that the question above ...
13
votes
2answers
423 views

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

The pst-node package provides the \ncdiag command, which allows you to connect two nodes with a diagonal line, but with an extra arm parameter which puts a bend in the line and allows the connections ...
77
votes
4answers
7k views

How to create magnified subfigures and corresponding boxes for portions of a large image

Updated Below I hope the title gets at what I'm trying to do. I have a large image for a thesis on an image processing topic, and I want show the large image, with zoomed in boxes (typically with the ...
20
votes
2answers
3k views

Arc between arrows in TikZ (automata library)

Here's what I have for now: \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=3.5cm, semithick, bend angle=35] \tikzstyle{every ...
4
votes
1answer
526 views

How to animate a path or how to draw starting fraction of a complex but linear path?

I would like to reproduce something similar to Animating Protocols but with a compound path and not a straight one. \documentclass{standalone} \usepackage{tikz} \usepackage{animate} ...