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)

4
votes
1answer
593 views

FOSS for real-time PGFPlots

Any FOSS for real-time PGFPlots? Is it worth opening a feature request for KtikZ (QtikZ)?
4
votes
1answer
662 views

Aligning tikz nodes to tabular cells?

I would like to make a Zwicky Box by using tabular combined with an overlaying tikzpicture. How can I (semi-)automatically align nodes to the vertical and horizontal center of their corresponding ...
11
votes
2answers
2k views

Crossing paths in TikZ without intersection

Once again, I'm preparing a new logic puzzle; Resuko to be precise. For the race track, I would like to have a symbolized bridge/underbridge -|-. I searched this site, but only found this question: ...
7
votes
1answer
2k views

Pattern in \addplot inherits dashed option from previous \draw

I want to fill the area between two curves with a pattern, let's say horizontal line. Since I want some other dashed lines below these curves, I use \draw[dashed] and then \addplot[pattern=horizontal ...
10
votes
2answers
844 views

Irregular Polygon with Angle Labels

I am looking to create the 15-sided irregular polygon figure below, without having to declare coordinates for each point. Is there an easier way to do this? Tikz? PGF?
12
votes
3answers
819 views

Draw a cylindrical spiral with TikZ

I want to make a tikzpicture to illustrate the construction of a spiral capacitor. These are made of spiral coiled films. So imagine a rectangular paper that you tail around one side. Thats basically ...
4
votes
1answer
262 views

PGFPlot/Tikz Legend Error

I wish to add a legend to my two plots - red and black, but the legend seems to have some scaling issues. I think it may be due to the changes made in shifting and domains, but I am not sure! \...
2
votes
1answer
384 views

How to adjust the sign of implication sign

I want to get the following implication arrows: But according to percusse's suggestion not implies, not Leftarrow, description in the middle of an arrow in TikZ-cd I would get this: As you can ...
26
votes
10answers
2k views

Get the head, the tail, and the last element of a comma-separated list

I have a comma-separated list, stored in a macro. It is non-empty, and it has commas between the elements but not at the start or end. How can I get: the first element (a.k.a. the "head")? the last ...
7
votes
1answer
466 views

PGFPlots append text to all contour labels

Is it possible to append a text suffix (in my case a unit) to all labels in a PGFPlots contour plot? For example, consider the following plot: \documentclass{article} \usepackage{tikz} \usepackage{...
4
votes
1answer
537 views

How to draw and insert a symbol in TikZ

I want to make a symbol as shown below in TikZ. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[thick] (0,0) rectangle (3,1); \draw[thick] (0.5,0) -- (...
15
votes
1answer
986 views

How to draw the right ascension and declination of a vector in a rotated coordinate frame in TikZ?

During my research I came across the illustration of two reference frames. In my opinion this illustration is lacking, because the coordinate systems are not drawn. This makes it hard to understand, ...
5
votes
1answer
301 views

Append two lists for TikZ foreach loop

How can I make a TikZ foreach loop iterate over two lists consecutively? I had hoped that in my code below, the expression \firstlist,\secondlist would evaluate to 2,3,5,7,1,4,6, but it doesn't work. ...
4
votes
0answers
52 views

pgfplots: How to move bar labels [duplicate]

2 questions: 1) How do I move my data labels to the center of my bars? 2) How do I make the labels be purely data labels, and not cumulative values? eg I want the red bar labels to be the value of ...
5
votes
3answers
181 views

Conflict between TikZ and *.cls file

I am attempting to convert a document from one class to another. In the original class, I am able to use TikZ and PGFPlots for my graphics. However, in the new class, I receive the following error: ...
5
votes
1answer
1k views

Tikz: avoid two arcs in a graph being merged into one two-sided arrow [duplicate]

I'd like to paint a directed graph G(V,A) with directed arcs. The problem is that if I paint 2 arcs, one from a to b and one from b to a, the two arcs get merged into one two-sided arrow (not sure if ...
5
votes
2answers
762 views

Boxed text between pages

I've made boxed text into a manuscript using tikz by following the example in texamples, it works like a charm as long as the box is short enough to fit into a page. \documentclass{article} \...
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
14k 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
782 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
419 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
483 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
639 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
985 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] ...
6
votes
0answers
969 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
935 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
332 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
1k 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
353 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 ...
45
votes
1answer
31k 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
300 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
818 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
1k 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
408 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
165 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
117 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 ...