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.

learn more… | top users | synonyms (3)

14
votes
10answers
518 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 ...
0
votes
0answers
22 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 ...
5
votes
2answers
63 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: ...
4
votes
1answer
208 views

Error when creating a surf plot with matlab2tikz

I'm using matlab2tikz to generate the tikz code for my figures. When compiling the document with the figure code as below, i get an error: Package pgfplots Error: No such element: ...
4
votes
0answers
23 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 ...
7
votes
1answer
118 views

Connecting nodes with brace in TikZ

How would be possible to put a brace instead of a "line" connecting nodes and add some text above it with TikZ?
0
votes
0answers
30 views

error while converting surf error to tikz [duplicate]

I have used matlab2tikz to convert a figure from matlab to tikz, but while compiling it gives following errors main.tex:170 Package pgfplots Error: No such element: ...
8
votes
2answers
93 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?
11
votes
3answers
193 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 ...
2
votes
1answer
198 views

Minipage: trouble getting figures at top of page

I'm trying to fit these to flowcharts in one page. This is what I got so far, not so nicely done I think. Any suggestions how I can get the flowcharts at the top of the page, nicely next to each other ...
2
votes
1answer
64 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 ...
4
votes
0answers
36 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 ...
3
votes
1answer
41 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! ...
5
votes
1answer
293 views

not implies, not Leftarrow, description in the middle of an arrow in TikZ-cd

Is there a way to put $\nLeftarrow$ instead of some arrows in TikZ? Specifically, how do I change it to "B does not imply A" in the following code. \documentclass{article} \usepackage{tikz-cd} ...
4
votes
0answers
52 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, ...
4
votes
1answer
49 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. ...
6
votes
1answer
53 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} ...
5
votes
3answers
58 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: ...
4
votes
1answer
80 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) -- ...
2
votes
1answer
54 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 ...
1
vote
1answer
95 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 ...
5
votes
1answer
37 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 ...
9
votes
1answer
492 views

Possible to combine “…” and “x/y” in TikZ's foreach?

I'll start with a simple, minimal non-working example: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x/\y in {1/20,2/18,...,10/2} \node at (\x,0) {\y}; ...
3
votes
2answers
76 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} ...
5
votes
1answer
53 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 ...
5
votes
2answers
94 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? ...
8
votes
1answer
189 views

How to reuse the plotmark styles from PGFPlots outside the tikzpicture environment?

In a figure caption or in the main text I want to reuse the style of the plotmarks or the combination of line and symbol as in the figure legend. As I did not find a command to reuse the legend image ...
2
votes
0answers
37 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} { ...
3
votes
1answer
61 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 ...
8
votes
1answer
75 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 ...
7
votes
1answer
67 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 ...
2
votes
1answer
105 views

Rounding a coordinate in TikZ

I'm trying to combine animate's \multiframe command with a TikZ \fill command so that in every fourth frame, the top of my rectangle is moved by one unit: \multiframe{20}{rya=10+-0.25}{ ...
1
vote
1answer
41 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. ...
4
votes
2answers
200 views

Help with installing gnuplot in MacTex and using it with LaTeX

I have to draw a lot of PDF and CDF graphs in my document/presentation and in order to do that I installed gnuplot. In order to install gnuplot I took the following steps: 1- Download the sources ...
4
votes
1answer
339 views

Commonly used arrows with TikZ

In a previous question Gonzalo Medina and Peter Grill gave a solution to replace the \to arrow by an arrow generated by TikZ. For some people using TikZ in commutative diagrams, it would be perhaps ...
11
votes
2answers
158 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
103 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 ...
6
votes
1answer
228 views
+50

Strange error when combining Beamer, Animate, Tikz and Listings

I'm working on some slides where I show how code is actually executed in Java. Therefore I'm working with the animate package to generate animations. Without going into details, I've written a macro ...
2
votes
1answer
50 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
73 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] ...
0
votes
0answers
46 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 ...
0
votes
1answer
38 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} ...
19
votes
2answers
424 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 ...
4
votes
0answers
48 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} ...
12
votes
2answers
476 views

Modifying `*` and `o` style tikz arrows so that they are centered at the end of line

I would like to use tikz * and o arrows to indicate included/excluded endpoints in plots of piecewise functions, like for example the following one: However, it seems that tikz always aligns the ...
1
vote
1answer
40 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. ...
1
vote
1answer
105 views

Syntax Highlight in Winedt

I am using Winedt 7.1 and learning TikZ and I am thinking about to add the commands to the keyword.ini, in the help they mentioned, adding to many keywords may affect the performance. Is there a ...
1
vote
0answers
37 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 ...
2
votes
1answer
52 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} ...
4
votes
1answer
65 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 ...

1 2 3 4 5 90