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)

2
votes
0answers
42 views

How to add PGF plot marker separately to document? [duplicate]

Say I have some PGF plot, which uses some custom plot markers, for instance: \newcommand{\scaleofcirc}{0.85} \pgfdeclareplotmark{manualcirc} { \pgfpathmoveto{\pgfpoint{\pgfplotmarksize*\scaleofcirc}{...
17
votes
2answers
13k views

How to rotate a TikZ label

I need to place information below and to the right of a grid. I was not able to rotate the label text of a node. I ended up using \rotatebox, but is there a pure TikZ solution? \documentclass{...
2
votes
1answer
777 views

Nodes near coords gives Undefined Control Sequence

I have the following example of a graph. I want to place the items in the table "Restart" next to the nodes. Everything works until I add "nodes near coords", I get a bunch of errors saying "Undefined ...
7
votes
1answer
6k views

pgfplots scale legend position when below xlabel

When using matlab2tikz to generate a .tikz from Matlab where the legend location is set to 'SouthOutside' (below the ylabel of figure), the position of the legend will cover the ylabel unless the ...
8
votes
1answer
2k views

New line in pgfplots/tikz not displaying in TeX

I have a multiple-line legend entry to preserve the width of my figure. I can use \newline in Matlab and the legend entry is split between two lines. When I produce a .tikz of the figure however, I ...
1
vote
1answer
414 views

Add labels to y ticks in bar chart [duplicate]

I'm just starting to mess with pgfplots and just had a quick question in formatting bar charts. Specifically, I was trying to add labels to each of my y ticks and i couldn't figure it out. \begin{...
11
votes
2answers
473 views

Access loop variable outside loop

Here's what I have created, but how could I access the loop variable \n outside the foreach loop so that I could write sth like this: \n = \n + 1 % this is definitely not right, and it seems I couldn'...
8
votes
2answers
627 views

How to align parent nodes to the left/top in a tree

I am drawing trees in LATEX. The qtree library seems to be what I need but the parent is always placed in the center of its children like this: parent / \ child_1 child_2 (I'm a new ...
19
votes
1answer
1k views

TikZ image with hyperlinks --> GIF/PNG image + HTML image map

I have a (complex) TikZ-based figure with hyperlinks. Now I need a web version of this figure that preserves all hyperlinks. Converting the PDF to GIF or PNG is trivial, but for the hyperlinks I ...
4
votes
1answer
967 views

Modulo calculation in PGFplots tick label

I am printing a diagram and want to use a_[0...3] as tick labels on the x-axis. Right now I have a[0...7] as labels and look for a way to print a[\tick mod 4] (i.e. a_0, a_1, a_2, a_3, a_0, a_1, a_2, ...
2
votes
3answers
201 views

Drawing a root-less graph of nodes with shared children

My aim is to produce a graph as illustrated by the code below: ( I am not yet allowed to post pictures) \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[node distance=4cm] ...
5
votes
0answers
953 views

english documentation of tkz-euclid [closed]

I just can't find the english documentation of tkz-euclid. ftp://ftp.fu-berlin.de/tex/CTAN/macros/latex/contrib/tkz/tkz-euclide/README says http://altermundus.fr (en français) or http://...
0
votes
1answer
1k views

tikzpicture within figure caption [duplicate]

Has anyone an idea how to use tikzpicture WITHIN a figure caption? What I want is, plot a blue circle withing a figure caption, like: \begin{figure}[ht] %... \caption{CaptionText \begin{tikzpicture} \...
12
votes
2answers
926 views

Gaussian ellipsoids using tikz

I'm trying to draw illustrations of Gaussian ellipsoids using shaded ellipses. In simple terms what I'm after is a way to have a light shade throughout the outer edge of the ellipse and a darker shade ...
9
votes
2answers
329 views

How do I encircle a partial table in tikz?

I am trying to create a diagram that looks roughly like this picture: Except that I want it to have rounded corners. It seems that the obvious way to do this would be to use tikz, so I have made ...
4
votes
0answers
62 views

Decimal number in axis tick using: “x tick=data” [duplicate]

I have found the following problem during the building of an histogram: \documentclass[a4paper,11pt]{article} \usepackage{pgfplots} \pgfplotsset{/pgf/number format/use comma,compat=newest} \begin{...
1
vote
1answer
982 views

pgfplots, toks, position of pin edge

I want to use pins to comment specific points in a diagramm. When I use a edge like -> it works fine. But if I use *- for example then the center of the dot is not at the position it should be. ...
6
votes
1answer
1k views

Semantics for parametric plots with pgfplots

I wasn't able to find in the pgfplots manual the exact semantics for pairwise mathematical expressions. Could you clarify the following variations? % Assume x(t) is parametrized by t in [0,1] and ...
1
vote
1answer
347 views

Define tikz node based on pagenodes

I want to define a tikz node called current grid area based on the nodes defined by the tikzpagenodes package. This node is a rectangle that contains the 4 nodes defined in the package; current page ...
4
votes
1answer
177 views

Using remember picture with pgfplots

The two rectangles in the example plot, by my reckoning, should overlap exactly. I would be most grateful if somebody could explain why they don't! My presumption is that this is a bug in my TikZ ...
10
votes
1answer
8k views

Boxplot in LaTeX

I am new to LaTeX. How can I draw a boxplot in LaTeX. My data set is as below index median box_top box_bottom whisker_top whisker_bottom 0 1 1.2 0.4 1.5 0.2 1 2 2.3 1.5 2.7 1 2 0.7 1.4 0.5 1.9 0.1 ...
3
votes
1answer
9k views

How to define the default vertical distance between nodes?

Use positioning can control the individual vertical position of nodes. But is there any way to control the default vertical spacing? \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{...
28
votes
2answers
1k views

MATLAB like command box

hello i am trying to set up style for script box. so far i got \begin{script*} >> help \end{script*} working and displaying i want final version to look some what similar to this picture ...
43
votes
1answer
30k views

How can I embed an external image within a tikzpicture environment?

I want to embed an image within a tikzpicture environment. I tried the following, \begin{tikzpicture}[] \pgftext{\includegraphics[width=150pt]{pic1.png}} at (0pt,0pt); \pgftext{\includegraphics[...
1
vote
1answer
1k views

Broken tikz chains

I tried to use the tikz chains feature today, and all was good for a few hours, but now I get an error every time I try to use chains ./test.tex:7: Package pgfkeys Error: I do not know the key '/tikz/...
2
votes
1answer
298 views

How to add cyrillic text to tikz image?

I tried the following: \documentclass[landscape]{article} \usepackage{tikz} \usetikzlibrary{backgrounds, shapes, arrows} \begin{document} \begin{tikzpicture} \node at (10pt, 50pt) {Й}; \end{...
6
votes
1answer
1k views

pgfplots: Splitting xlabel on two lines

I want to split xlabel into lines. My MWE is below: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.7} \begin{document} \begin{tikzpicture} \begin{axis}[ % xlabel =...
2
votes
1answer
812 views

Help With TikZ: Recreating Diagrams from e/m Ratio Experiment—Helmholtz Coils and Circuitry

I have two images I need to recreate in TikZ. The first is that of Helmholtz coils and their spacing in the experiment: And the second being the wiring for the coils: My (very) Minimal working ...
9
votes
2answers
999 views

How to add legend to contour plots?

The following does not work: \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[view={0}{90},legend entries={foo,bar}] % 'legend entries' causes ...
4
votes
1answer
405 views

how to make this circles?

I would like to make in LaTeX these circles. How can we add the words in them? The color for the big one?
3
votes
1answer
163 views

How to color numbers in axis?

I want to color the numbers 3 in blue and -1 in green as show in the picture below. My code is this : \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \...
3
votes
0answers
116 views

Scale font in TikZ plots [duplicate]

I have a lot (~100) of TikZ plots, autogenerated with a popular matlab script. I want to resize the font of the plots, because it is currently too large. I googled a bit, and found some answers (even ...
12
votes
1answer
2k views

Help creating solid cylinders along a path in Tikz for crystal lattice diagram

I am trying to draw a diagram using Tikz that will show the crystalline lattice structure of diamond. It should look like the following illustration (reference). I have managed to figure out the ...
8
votes
1answer
918 views

pdflatex nonstopmode with TikZ stops compiling

I compiled a TikZ code using pdflatex -interaction=nonstopmode. Depending on code errors, compiling stops. I want to know what went wrong. Let me show you two cases, both of which involve a code error ...
9
votes
6answers
5k views

Draw an aircraft with Tikz

I want to draw a plane using the Tikz tool. You will find, attached, a screenshot.
3
votes
2answers
403 views

Calc and \settocdepth break \tikzexternalize

This might well be the strangest TeX behaviour I've ever seen and that's saying a lot. The following really is a MWE as far as the header is concerned: \documentclass{memoir} \settocdepth{subsection} ...
2
votes
0answers
341 views

Title page report with TikZ [closed]

I want to make the front page shown in the attached PDF. Someone! help me?
9
votes
3answers
677 views

Parallel lines on a grid and circle best practices?

I am a TeX/LaTeX noob, but I am learning rapidly. I am about to attempt to draw the following figure using LaTeX/TeX/TikZ I already have a, (I think) good working knowledge of how to draw circles, ...
4
votes
2answers
164 views

Boxing a number and aligning it vertically along the baseline

I am making a big list of exercises and I'd like to box the number of the exercise at each line. I found this: \tikzstyle{square}=[minimum width=0.5cm, minimum height=0.3cm, rectangle, rounded ...
5
votes
1answer
981 views

Right Angle Symbol Alignment with TikZ/Calc

I used a solution from @Jake from this post Insertion of Perpendicular Symbol at Intersection of Two Lines, but the alignment is not quite right. I have my suspicions why, but I don't understand the ...
4
votes
1answer
398 views

Text decoration is trimmed off with standalone package

I am decorating an arc with text as shown in this MWE using the standalone class: \documentclass[10pt,class=article]{standalone} \usepackage{tikz} \usetikzlibrary{decorations.text} \begin{...
17
votes
1answer
14k views

Where is the pattern list gallery for pgfplots?

Where is the list, or gallery of the patterns available for pgfplots?
5
votes
1answer
618 views

Vertical path to node in TikZ trees

How can I set the path between two specific nodes to "vertical" rather than "direct"? Currently my tree looks like this: \begin{tikzpicture}[level distance=1.5cm, every node/.style={draw=black,...
2
votes
1answer
792 views

Polar plot: label and legend rotation

I am using the polar library with pgfplots to plot a graph like this: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat = newest} \usepgfplotslibrary{polar} ...
14
votes
1answer
1k views

Circular Arrows and Text on Path

I did some basic tikz figures, but i have absolutely no idea how to do a figure like this: Each text block should be aligned on a circular path and centered within the arrows. Could anyone please ...
2
votes
2answers
299 views

'Figure' in tikz makes image move 'forward'

I have a weird problem, whereby if I make my existing tikz picture a 'figure', it suddenly moves forward, as in, past the paragraph that comes after it in the code. That is, if the code that makes ...
2
votes
1answer
2k views

Vertical lines in pgfgantt

I'm using the package pgfgantt to create Gantt charts. I've seen that with the "today" key one can have vertical line drawn in the chart. However, only one today key is allowed. How can I have several ...
4
votes
1answer
373 views

Constructing dag-like diagrams

I want to draw diagrams that look a bit like this. Mathematically, you could describe them as directed acyclic graphs with dangling arcs. They're somewhat reminiscent of route diagrams. Desired ...
5
votes
1answer
317 views

How do I place braces on a line segment?

So I have this code here, \begin{tikzpicture} % Draw the axes \draw [->,black] (-1.5,0) -- (3,0) ; \draw [->,black] (0,-1.5) -- (0,3) ; % Draw the line \draw[-,black](...
1
vote
0answers
32 views

headlines are not shown with tikz input (plain TeX) [duplicate]

I'm usign plain TeX with custom headlines. If I load Tikz packages with \input tikz then headlines are blank. The following are my headlines (some commands don't belong to plain TeX, but I think ...