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)

1
vote
1answer
2k views

Using scalable sizes for rectangles, circles and nodes in TikZ?

How do you define the size of a rectangle, circle or node in TikZ to be scalable, like when you position objects using (1, 2) and then apply scale=2? What I'm looking for is to be able to scale the ...
12
votes
1answer
1k views

TikZ finishes a morphed path with a straight segment

When, in TikZ, I apply a path morphing decoration (say, "snake") and specify the segment length option, I often finish up with a straight segment at the end of the path, such as which often is not ...
13
votes
1answer
2k views

Adding values to pgfplot legend

As a follow-up to my earlier question (here), here is a question that is perhaps a little more latex than gnuplot. having used gnuplot and pgfplots to generate a fitted curve, is there an easy way to ...
15
votes
1answer
3k views

How can I express half the distance between two nodes?

I want to draw a line from node A half-way to node B in TiKZ. How can I find express the end point?
5
votes
1answer
862 views

How to center text between two rectangles in TiKZ?

I have the following TiKZ code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \newcommand{\delim}[1]{\draw(#1,-0.2) -- (#1,-0.5);} \draw (0,0) rectangle (1,1); ...
12
votes
1answer
3k views

Non-linear curve fitting with gnuplot

I am trying to use gnuplot with pgfplots in TexShop, following on from an example by Martin H in the comments here. I can get the data points in OK, and plot them but the fit (red line) does not seem ...
6
votes
3answers
2k views

Why doesn't relative coordinates in TikZ work with this example?

I was working on a figure, and for some reason relative coordinates have stopped working (it did before). I removed all code down to a bare minimum, and they still don't work. I don't know what I've ...
4
votes
1answer
528 views

How can you update the current relative coordinate in TikZ without adding an element?

Is it possible to update the current relative coordinate in TikZ without actually adding anything to the picture? For instance, \node at ++(1, 0) (node1) {...}; will update the current x coordinate ...
6
votes
1answer
669 views

How to generate named nodes from the counter used in `foreach` in TikZ?

I'm trying to generate multiple nodes in TikZ using the foreach operator, but whatever I try I get compilation errors. I need all nodes to be named in order to draw edges between them. Having read ...
8
votes
1answer
2k views

TikZ: Variable arithmetic result in node name

I'm having trouble incrementing a variable in TikZ and then using the result as part of a node name: \def\x{2} \begin{figure}[H] \begin{tikzpicture} \pgfmathsetmacro{\xplusone}{add(\x,1)} \node ...
4
votes
1answer
576 views

Best way to replicate the node diagram in LeeMcq08?

Q: What would be the best (I'm sure there's some subjectivity involved) way to replicate the univariate distribution relationship diagram of LeeMcq08? From what I can gather Inkscape and TikZ along ...
1
vote
1answer
207 views

Looping and linking with TikZ

How would you build a grid using a nested foreach, defining one node for each iteration? If I were coding in Python, I would write: nodes = {} for i in range(10): for j in range(5): ...
6
votes
1answer
1k views

meta arrow tips

Page 316 of the tikz-pfg manual describes meta arrow tips and says that usually we do not want to have the tip scaled the same way as the supporting line. Is there a way to keep this feature, ie, when ...
4
votes
3answers
332 views

PGFkeys problem. Meta arrow tips with parameters works only when I use different line width. Why?

The solution given here has a problem. Let re-write a minimum example \documentclass{standalone} \usepackage{tikz} \makeatletter \tikzset{arrow length/.initial = 6pt, arrow angle/.initial ...
3
votes
1answer
714 views

No Color Showing in TikZ Drawing

I am trying to draw some pictures using TikZ within LaTeX. I have started by using simple examples, but I am having trouble getting colors to show. For example, I use the following commands, but only ...
7
votes
2answers
1k views

Define a color in a tikz style

How do I do a definecolor in a /.style? \pgfkeys{/IMMstyle/.style={ inputnode/.style={shape=ellipse,draw,inner sep=2pt,minimum size=5.0mm}, \definecolor{dpred}{rgb}{0.50,0.35,0} ...
2
votes
1answer
1k views

In Tikz, how can I specify where an edge connects to a child node?

I have a Tikz graph that looks something like this: \usepackage{tikz} \usetikzlibrary{shapes,positioning,shadows,arrows} ... \begin{tikzpicture}[ singleNode/.style={rectangle, draw=none, ...
10
votes
3answers
1k views

TikZ: how to find the intersection of two extended lines?

From How to draw a line passing through a point and perpendicular to another? I learned to use shorten to extend lines. But the extended part doesn't seem to "really exist". For example, I would like ...
36
votes
3answers
11k 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... ...
17
votes
1answer
2k views

How to zoom a portion of TiKZ picture?

I want to draw a small rectangle within a tikz picture, then zoom it out somewhere. I skim through the PGF manual but I couldn't find a way to put the logic together. So far I've just drawn the ...
10
votes
2answers
1k views

Making arrows not touch in TikZ

I'm trying to make a fairly simple diagram using TikZ, along the lines of the following examples: \begin{tikzpicture} \draw [->] (0,0) node[anchor=south]{A} -- (1,-2) node[anchor= north]{D}; \draw ...
1
vote
1answer
148 views

flacards and forloop is working but not with tikz foreach

My flashcard with \forloop is working after your help. I try it with \foreach (tikz) but it's not working. The pdf files contain only one flash card in the bottom right corner, the 24th card and the ...
5
votes
2answers
4k views

pgfplot: Customize the axis wide scientific notation multiplier

Hy Guys, I'm experiencing two problems with ticklabel formats. First, if I explicitly set scaled y ticks = true, the base ten notation still appears at every tick. Here's the diagram: Here the ...
-2
votes
2answers
890 views

Factorial-design diagrams in TikZ

I'd highly appreciate if someone could give me hand to draw this diagram in TikZ.
17
votes
1answer
23k views

TikZ Adding Text

I'm a recent convert to TikZ from xy-pic, and am still trying to get a hang for it. I see that one can add labels to the end of arrows and the like using \node. Is there a way to add an arbitrary ...
5
votes
1answer
3k views

Specifying a domain and pgfplots

I'm making a graph with pgfplots with a specific domain, but the graph's domain (both x and y) are not changing. I'm reading through the pgfplots manual and I think I'm doing the right thing except ...
9
votes
1answer
5k views

TikZ automata: size of circle around nodes

I am trying to replace vaucanson-g with TikZ, but I cannot make the automata as small. There seems to be a minimum size of the circle around nodes, that I can't reduce even with inner sep=0. Example ...
11
votes
1answer
2k views

spiral spring in tikz

I'm aware of the possibility to easily draw linear springs with tikz but what about spiral springs (torsion)? It looks like there is nothing ready and a long journey in pgf is necessary. I could ...
5
votes
1answer
675 views

Automagically scale Tikz-Picture AND use Externalization

I need to scale Tikz pictures automatically, and I do this using the following custom environment: % Automagically scale a Tikz picture, so it has the desired (given) width. % Does NOT scale line ...
12
votes
1answer
1k views

How to combine a timeline with a calendar

I'm using the pgfgantt package to create a timeline. This is what I've got so far: \documentclass[landscape]{article} \usepackage[dvipsnames,usenames]{xcolor} \usepackage{tikz} \usepackage{pgfgantt} ...
17
votes
2answers
836 views

equivalent of pstricks rput in tikz

A very powerful feature of pstricks is its possibly nested rput command that can be used to rotate and move a portion of a drawing. Is there something similar in tikz?
9
votes
1answer
1k views

PGFplots skip the first row of a table on which there are NaN values. Why?

Suppose to have a file .dat like this: -4.8767000e+000 -2.9142000e-001 NaN NaN NaN NaN -3.9017000e+000 -4.1404000e-001 NaN ...
5
votes
1answer
390 views

Labels in TikZ are incorrectly interpreted

I'm running into a weird problem with TikZ. The following code \node (A) [label=45:$A$] at (p2) {}; is rendered correctly in one document, but incorrectly in another, larger document (which uses ...
6
votes
1answer
543 views

Macro inside TikZ node properties

I was looking for a way to use a conditional expression to define the node type in TikZ. Specifically, I wanted to do something based on the section number. ...
4
votes
2answers
777 views

Using colors defined with spotcolor.sty in TikZ

I would like to specify pantone colors. spotcolor.sty seems to to the trick when compiled with pdfLaTeX: \documentclass{article} \usepackage{color} % \usepackage{xcolor} % Does not work ...
4
votes
0answers
1k views

Problems by enlarging tex memory [closed]

I have a problem with the tex memory while using pgfplots and a very huge dataset in Ubuntu. Under Windows with MikTeX I have the following settings and the texfile compile without any problems: ...
3
votes
1answer
486 views

Arrow scaling problem. How can I zoom properly a very tiny part of a drawing?

Thanks to this solution, I can draw tangent line to a path. I'd like to zoom a very little part of my drawing. Here it is the code: \documentclass{standalone} \usepackage{tikz} ...
5
votes
1answer
415 views

With TikZ, How do I use a labeled coordinate that's inside a node?

In the following diagram, I'm trying to draw a line from the center of the red dot (inside the blue node) to the green node. The coordinate of the red dot is labeled "thepoint", so this should be ...
9
votes
3answers
354 views

How to learn to create General (Functional) Shadings wifth pgf?

In the section called General (Functional) Shadings in the PGF/TikZ manual, there is an "explanation" of the command to create a general functional shading. The author of this section assumes that ...
3
votes
2answers
1k views

Remove “white parts” of tikz picture

I have a tikz picture, which consists of a visible part on the left side and a white part on the right side (for some constructive reasons). Now I would like to redefine the size so that the new ...
8
votes
3answers
1k views

Cut-off cone in TikZ

How would I draw the following cone using TikZ? I have no clue how to incorporate the "cut-off". I want to draw a picture of the cone given by the points (y, t) for y in R^d and t in (0, infty) such ...
1
vote
1answer
860 views

Migrating from tkz-2d to tkz-euclide

I want to use the example in http://www.texample.net/tikz/examples/morleys-triangle/. I changed the tkz-2d into tkz-euclide (as tkz-2d is superseeded by this package), but tkz-euclide doesn't know ...
8
votes
3answers
1k views

How to draw a circular cone

I want to draw the circular cone given by the equation z²=x²+y². (I do not mind using any given package.) I tried to use the pst-solides3d package with the help of its manual to generate the ...
5
votes
3answers
501 views

Visualization in LaTeX of hamming distance

I have for example the following two strings: 1: 00101101 2: 00100100 I would like that each number will be place in a box and the boxes with the number one should be higher then the ones with ...
7
votes
5answers
1k views

Tangents to a circle from a point outside of it (tikz)

I'm trying to plot in TikZ the two tangents to a fixed circle passing through a given point. In some details, given an arbitrary circle centered at C with with radius r, and a point P outside of the ...
10
votes
1answer
557 views

Automatically add fractions and reduce the result (if neccessary)

I'm trying to figure out how to reduce fractions. Adding fractions is no problem, see this example: \documentclass[parskip]{scrartcl} \usepackage[margin=15mm]{geometry} \usepackage{tikz} ...
0
votes
1answer
1k views

tikzpicture blank in preview

Using preview-latex to preview the tikzpicture environment shows either a blank rectangle in pdf mode or simply produces no preview file in ps mode. I am using aquamacs 23.3a, using auctex and gs ...
12
votes
2answers
760 views

Automatically avoid more than one node when drawing a path

Background Andrew Stacey's answer to Automatically connect nodes without overlapping other nodes or connections presents code to make a path avoid a node by going through a corner of that node ...
9
votes
3answers
679 views

Adding vertical noise to a path

For a presentation I want to make a figure showing a graph of a signal with noise. I draw the signal as curved path \begin{tikzpicture} \draw [thick,blue] (0,0) .. controls +(50:3) and +(160:2) .. ...
4
votes
0answers
170 views

Quote style like on owni.eu [duplicate]

Possible Duplicate: Block quote with big quotation marks How can I reproduce with TikZ the quoting style from Owni.eu http://owni.fr/2011/09/13/increvable-droit-dauteur/ in a environment? ...