As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [tikz-pgf]

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.

Filter by
Sorted by
Tagged with
21 votes
3 answers
102k views

TikZ: position with different anchors

I would like to label lines at the same midway horizontal position (pos=0.5). But as the second line is tilted, the labels lower left corner should touch the line. Hence, I would need to manually ...
4 votes
1 answer
2k views

Different backgrounds for title and "normal" frames in beamer

I want to draw different backgrounds for the title frame and normal frames in beamer, using tikz. Doing this for the normal frames was straight forward, but that background now also shows up on the ...
4 votes
2 answers
3k views

Line break in datapoint label with pgfplot?

I have a bar chart, with labels for each column. I would like to break these labels over two lines. I'm not using nodes so the "align" trick doesn't seem to apply. Minimal example: (from Lyx) \...
6 votes
2 answers
1k views

Wraparound of tikz pictures in twocolumn layout

I am currently typesetting a document in a two column layout. Many text blocks are put into colored boxes, currently implemented with TikZ. This works; however, I have to split the text blocks ...
10 votes
2 answers
2k views

How to maintain the ratio between two axis in pgfplots

I have two axis environments both containing different plots. I do however want to maintain comparability between both, i.e. I want both plots to consume the same space on the paper for a coordinate ...
8 votes
1 answer
2k views

Change TikZ's default coordinate system

In the TikZ manual I read that the default coordinate system's spacing is 1cm, so that (1,1) would be a vector going 1cm in x-direction and 1cm in y. In a diagram with a lot of nodes, that I am ...
44 votes
1 answer
16k views

what is the [count=\i] in \foreach for?

Can someone explain what does [count=\i] in a foreach mean? Antal S-Z's answer to Fitting a list of points with TikZ and its \foreach use this. It is also mentioned in Increment loop variable in ...
10 votes
2 answers
3k views

Timing and integration with TikZ PGFlots

How do I set intervals or integration with TikZ PGFlots? Something similar to the figure below, but I want to define the function, the intervals of integration and the partitions. \documentclass{...
6 votes
2 answers
4k views

Filling triangle doesn't seem to work with PGF/TikZ

I was wondering if anyone had any clue on why my triangles are not filled in red within the following piece of code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,3d} \usepackage[...
11 votes
1 answer
2k views

Using TiKz to draw cobordisms

As @Heidar says in the comments I see there is now a package for doing the cobordism diagrams (Topological Quantum Field Theory diagrams with pstricks or tikz) and I encourage others to use it as well....
12 votes
4 answers
4k views

How to color a region?

The following code \documentclass{article} \usepackage{tikz} \usetikzlibrary{intersections,positioning} \begin{document} \begin{tikzpicture}[radius=5] \draw (0,0) rectangle (5,5); \draw[name path=...
6 votes
1 answer
1k views

Side braces - can somebody make sure I'm reading this right?

After some trial and error, and a little help from this stack overflow question I was able to put together this code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations....
1 vote
1 answer
564 views

Symbols for EAI diagrams in TikZ/PGF?

I would like to produce some diagrams (preferably using TikZ/PGF) using the visual notation given in Enterprise Integration Patterns by Hohpe & Woolf. I'm aware of stencils from the above site, ...
5 votes
2 answers
830 views

Pass several comma separated TikZ options to a single keyval key

I'm still improving my answer to Need help creating a 3D cube from a 2D set of nodes in TikZ. One of the options should be to emphasize the edges of the cuboid. This would mean e.g. \draw[red, very ...
13 votes
1 answer
4k views

Multi-line nodes/annotations in pgfplot

It would be great if I could get the annotation in the graph depicted below on two lines, but I can't seem to figure it out. Presently, I have: \begin{tikzpicture} \begin{axis}[ xlabel={$...
4 votes
0 answers
3k views

How can I export pdf files with tikz/pgfplots? [closed]

I am writing a long thesis and would like to source out some graphics, so that I do not have to in every run I am compiling the tex file. Here is a simple example: \documentclass[a4paper]{scrreprt} \...
15 votes
2 answers
6k views

Asymmetric "enlarge x limits" in pgfplots

I need to specify different "enlarge x limits" for the lower and upper axis extrema. Something like enlarge x limits={{value=0.2,upper}, {value=0.4,lower}} does not work however. Any ideas? Using xmin ...
15 votes
2 answers
915 views

Improving TikZ user interface

I am looking to improve both on the concept as well as the user interface for code used to produce visual progress charts. The figure represents activities and progress for the construction of high-...
6 votes
3 answers
2k views

How do I set the minimum width of a subfigure?

I have: \subfigure[blah blah blah.] { \begin{tikzpicture}[/MyStyle] ... some stuff... \end{tikzpicture} } But "some stuff" is not that wide and the text in the subfigure produces a lot of ...
3 votes
1 answer
234 views

Linking text nodes in a page

I'd like to know what package can link nodes in different parts of a page. To simplify my question I uploaded an example extracted of tkz-linknodes manual (AlterMundus). Please note that the page ...
5 votes
1 answer
2k views

Tikz overlay picture over the frame title in Beamer

I am trying to put a tikz overlay picture - A nice, thick red 'X' over a word - On the frame title of a Beamer frame. However, the overlay tikz picture in the frame does not recognize the nodes given ...
6 votes
1 answer
4k 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 ...
21 votes
1 answer
23k views

Choosing data columns with Tikz plot

I want to plot data from a file using Tikz. I have a data file with 5 columns of data, and I want, for example to plot column 1 and 3 together. How can I make Tikz load the data from the correct ...
12 votes
3 answers
1k views

How to rotate hyperlink with text

How can I rotate the link of a text in a node. Here is my MWE: \documentclass{article} \usepackage{tikz} \usepackage{hyperref} \begin{document} \begin{tikzpicture} \node (rect) [rectangle, fill=...
3 votes
3 answers
6k views

Margins in \framebox

I have the following code: \documentclass{article} \usepackage{tikz} \begin{document} \framebox{\begin{tikzpicture}[color=black, line width=0.4mm] \draw (0,0) rectangle (5mm,5mm); \end{...
19 votes
5 answers
2k views

What tips and tricks are there for debugging TikZ/PGF code?

When answering questions here and when drawing my own complicated TikZ/PGF drawings, I've developed a fair number of "tips and tricks" for debugging the code. I'm sure that others have as well. I ...
3 votes
1 answer
2k 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 ...
6 votes
2 answers
798 views

Creating a line of given length with variable number of "snags" equally separated (TikZ)?

I want to achieve the following in TikZ: To get the exact width of the line I have no issues with - the problem lies in adding an arbitrary number of snags along the line which are equally distanced ...
11 votes
1 answer
11k views

Positioning TikZ pictures in beamer slide

I am trying to position a TikZ picture on a beamer slide but some nodes (well, not all?) get pushed to the right. I have tried to add % wherever it seemed fitting as mentioned in Tikz figure in ...
2 votes
1 answer
1k views

Using an array element to specify end iteration point in TikZ "\foreach"?

Is it possible to access an array and use one of its elements to specify the last iteration point in a TikZ \foreach? I've tried with the code below but I keep getting a compilation error: ! ...
4 votes
2 answers
4k 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 ...
22 votes
1 answer
2k views

How to fix TikZ corners in 3D

Am trying to draw a simple rectangle and there seems to be minor issue with two of the endpoints (f and d in the following). I tried line cap=rect as suggested by Bad intersection of lines in TikZ but ...
5 votes
2 answers
6k views

Center text node

I currently have the following TikZ code: \documentclass{scrbook} \usepackage{tikz} \begin{document} \tikzset{ tlstartyear/.style={ name=tlstartyear, above=5pt, ...
4 votes
1 answer
196 views

Why doesn't the column align properly while the row does in this TikZ picture?

For some reason, the column doesn't align properly with matrix B. And I can't figure out why. I hate having to resort to using yshift this many millimeter this and this many millimeter for this. \...
1 vote
0 answers
212 views

Externalized figures newenvironment [duplicate]

Possible Duplicate: Problem with environment expansion and the Tikz external library. I want to externalize some of the TikZ figures of my document. To do so I am using the \beginpgfgraphicnamed ...
46 votes
1 answer
32k views

How to prevent pgfplots from using the 10^n notation for axis ticks [duplicate]

When creating a plot like this one \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot coordinates { (...
0 votes
0 answers
184 views

How to form braces or brackets used in math formulas around nodes in a TikZ picture? [duplicate]

Possible Duplicate: Adding a large brace next to a body of text I'm trying to create a brace or bracket around two or more nodes within a TikZ picture. Since there are more elements in the ...
12 votes
2 answers
5k views

Making an image with a transparent background

I do not know what is the official term for such images, but if I make an image in TikZ or pstricks then I want it to have no background; for example I might post it on a webpage with a different ...
2 votes
1 answer
2k views

Tikz and alignment with two nodes on the same line

Another minimal example: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[draw=black,% rounded corners=2pt,% rectangle,% bottom color=black!80!white] (A) {node ...
11 votes
1 answer
7k views

Rectangle around data points in pgfplots

If I have some data points in a pgfplot, how can I draw a rectangle around them, with the rectangle using the same coordinate system as the points? I've included an example which does not work below. ...
11 votes
2 answers
2k views

Problem filling intersection using TikZ

I was trying to use TikZ to draw a figure, I want to fill the common area of four circles of which centers are at four points of a square, and the radios for the arc is 0.9772 of the length of square. ...
37 votes
3 answers
27k views

Moving a label along the path

Friends, consider the following code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{automata,positioning} \begin{document} \pagestyle{empty} \begin{tikzpicture}[shorten >=1pt,node ...
2 votes
1 answer
482 views

TikZ and different alignments on the same line

This is my minimal example: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[draw=black, rounded corners=2pt, rectangle, bottom color=black!80!white, text width=...
12 votes
1 answer
13k views

Forcing TikZ minimum size for nodes

I have a tree structure consisting of many unlabelled nodes. However, for some reason the nodes are far larger than I would like and appear to have a minimum size below which the minimum size key is ...
1 vote
1 answer
3k 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 ...
9 votes
1 answer
2k views

What are the guidelines for making TikZ pictures properly scalable?

I've just started using TikZ for rendering figures for my Master thesis. I've made a few and they look good in the report. But when I tried using them in my presentation slides, some were too small ...
16 votes
1 answer
2k 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 ...
28 votes
1 answer
8k 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
1 answer
2k 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); ...
11 votes
1 answer
5k 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 (X\...

1
657 658
659
660 661
668