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)

9
votes
1answer
761 views

Node spacing based on node boundaries [duplicate]

TLDR: Is there a way to get the nodes to space based on their 'tips'. Thus avoiding the x-scale=#cm all over the place to get things just right. I am in the process of converting a bunch of visio ...
3
votes
1answer
636 views

Plot marks filled and drawn, but not the path

Is it possible to have it so that the plot marks would be filled and drawn, but the actual path wouldn't be drawn? Here is example where it is otherwise the way I'd like, except those dots' should be ...
9
votes
1answer
2k views

TikZ: turning edges into arrows using “child” notation

I'm using TikZ for the first time to draw a simple Kripke model, and I'm using the child notation to produce new nodes. How can I turn my edges into arrows? \begin{tikzpicture} \node [circle,draw] ...
2
votes
1answer
98 views

TikZ: lineto to a just created node

Often, when drawing diagrams with TikZ, I’d like link nodes by edges just as I draw them. But when doing it the naive way, e.g. \draw (0,0) node {A} -- (1,0) node {B}; the line intersects with the ...
18
votes
2answers
338 views

Does a zero-length line with an arrow make sense? Is it a bug?

\documentclass[pstricks,border=12pt]{standalone} \usepackage{pstricks-add} \begin{document} \multido{\i=0+30}{12}{% \begin{pspicture}(-2,-2)(2,2) \pscircle{1} \pnode(1;\i){R} ...
7
votes
3answers
844 views

Draw only part of a rectangle in Tikz

How can I draw only parts of a rectangle? I want to omit a small part of the rectangle to put some text in. As I'm using various complex rectangles, I do not want to construct own "open rectangles". ...
2
votes
3answers
200 views

Macro to check if an element is a member of a list, and access associative lists

Inspired from Macro to access a specific member of a list. I want to have a macro implementing the lisp functions (member item list) and (assoc id alist). The first checks if an item is contained in ...
13
votes
2answers
1k views

Path to midpoint of other path

I would like to end a path at the midpoint of another path. My inclination has been to try and end the path at an offset equal to half the node distance from d.north, but any thing I seem to try will ...
3
votes
1answer
291 views

Is tikz the easiest way to draw a model like this?

I'm losing my fingers drawing this figure: Does anybody knows whether tikz is the best way to do that?
2
votes
1answer
605 views

TikZ change matrix cell color background

I have a TikZ code that generates this: using something along the lines of the following snippet. The full code corresponding to this snippet can be obtained from the answer to question ...
41
votes
5answers
3k views

3D helix torus with hidden lines

How can I generate the above image using TikZ (possibly other methods will work if they produce better looking results)? I would like to have a nicely shaded (not so dark image) without gridlines ...
8
votes
3answers
1k views

Improved Unit Circle Animation

I'm trying to improve the sine/cosine animation provided on texample.net to suite my needs. I wanted to add a plot of the sine and cosine part and tried using pgfplots for this, as it can evaluate and ...
3
votes
1answer
372 views

How to connect two childs? [duplicate]

Possible Duplicate: How two connect any arbitrary nodes of tree in tikz Hello everyone I'm new to latex. And just started using the tikz package to draw. I have here a code below, which is ...
4
votes
0answers
67 views

Rotate the fill pattern with the shape in tikz [duplicate]

Possible Duplicate: Moving tiles of the pattern in TikZ I have a rotated rectangle filled with a pattern, and I would like to also rotate the pattern by the same amount. In this MWE, the ...
7
votes
1answer
903 views

TikZ in LyX: Package tikz error?

I am trying to compile a document that uses the tikzpicture and pgf packages, but I am getting this error UPDATE Code: \begin{tikzpicture} \begin{semilogyaxis}[ ...
17
votes
1answer
2k views

TikZ two-blocks matrix

I would like to get a plot like the one I sketched below, basically two blocks of the same matrix with arrows going up and anti-diagonally for the red block and arrows going up for the green one. The ...
1
vote
1answer
180 views

tikz matrix keep spaces in text

I have a tikz matrix row1 & a b c & d e f \\ row2 & 1 12 16 & 34 2 55 \\ .... and I need to keep the spacing correct(basically use a monospaced font) for correctly ...
3
votes
1answer
220 views

Tikz matrix with header row

How can I create a tikz matrix where the first row is a header row with nodes that are centered and all other rows after that have the text left aligned H1 H2 H3 adfsf 34993 ddddd ...
6
votes
1answer
296 views

Positioning of rotated nodes in a matrix

I'm trying to create a tikz drawing similar to this picture: In the code below I have used matrix nodes for both of the "parts" but I can't get the phases (in the picture above the rectangles with ...
7
votes
1answer
1k views

Draw outside axis with pgfplots

I have the following diagram, and would like to extend the red line so it crosses the axes and goes on for a bit at the start and the end like in the second picture, but I would like the red and blue ...
4
votes
2answers
1k views

Fixing a circuit diagram

Making some electric circuits in tikz for the very first time, and need to replicate the following image Not a very complicated circuit. Now here is what I have done so far ...
10
votes
2answers
869 views

TikZ marking several blocks in a matrix

I would like to mark a few blocks in a matrix and I followed directions from other similar questions but I get a weird TikZ behavior .. seems that I can not have more than one marked block in a ...
5
votes
1answer
2k views

Snake decoration does not work with decorations.pathmorphing in tikz

I have simple example that works fine \documentclass[a4paper,12pt,oneside,titlepage]{report} \usepackage{tikz} \usetikzlibrary{snakes} \begin{document} \begin{figure}[H] ...
6
votes
1answer
557 views

Animated Merge sort example

I would like to create a merge sort example like this one on Wikipedia:Merge Sort. Can someone help me? here is what I've done so far, but it doesn't work properly and effects are not like in ...
9
votes
3answers
611 views

How do I make a script to make inkscape TikZ more human readable

When I export a svg file from inkscape to TikZ, the result is often huge, and not very human readable. I would like to write a perl script for post processing the output. The script should be able to: ...
7
votes
1answer
220 views

Layers don't work in an `overlay` picture

I have the following two tikzpicture, where the second needs the overlay. However, with that option, the line drawn from A to C goes through B, despite the \begin{pgfonlayer}{back}…\end{pgfonlayer}. ...
6
votes
1answer
642 views

Making the y-axis range of a plot have more values in some parts

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{pgfplots} \begin{document} \begin{figure}[H] ...
6
votes
2answers
1k views

Tikz realistic 3D grid

I need to draw a 3d isometric grid/lattice using tikz that is not visually confusing. It needs to be at least 6x6x6 but possibly bigger. I sort of would like to have it fade into the background or ...
1
vote
1answer
469 views

TikZ Compatibility [closed]

Is the TikZ package incompatible with other LaTeX packages? The preamble of my code is as follows. When I load the TikZ package, I cannot compile my file. Any help would be much appreicated! ...
6
votes
1answer
488 views

Plotting a straight line to the peak point of a graph

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{pgfplots} ...
5
votes
1answer
313 views

How to use coordinate in tikz?

The following is my code: \begin{tikzpicture}[node distance=5cm,auto,>=latex', scale = 0.75, transform shape] \coordinate (a1) [] {}; \node (rect) (a) [draw,minimum width=3cm,minimum ...
6
votes
1answer
310 views

How to define macros in a foreach loop with effects between iterations and after the loop without using global?

Without using \global, the following code: \documentclass{minimal} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{etextools} \newcommand\appendbyforeach[2]{% ...
8
votes
1answer
3k views

How can I achieve relative positioning in tikz [duplicate]

Possible Duplicate: Relative positioning of nodes in TikZ I'm creating a tree diagram in tikz and I know that calculating each point would be silly. For that reason, I want to place things ...
11
votes
1answer
1k views

How would you draw an arrow filled with a gradient?

I want to draw several large arrows filled with gradients at different locations. How would you do that ? I am new to tikz and latex and came to the following (ugly) solution: \def\y{0.4} ...
4
votes
2answers
571 views

position arc relative to circle [duplicate]

Possible Duplicate: Draw arc in tikz when center of circle is specified an very trivial question but I can't do it! Sorry but I find coordinates confusing. I would like to draw an arc ...
7
votes
1answer
414 views

TikZ UML diagram special character problem

I'm trying to create an UML diagram using TikZ and pgf-umlcd, unfortunately I seem to have some kind of special character problem and was not able to figure out how to escape them right, an example ...
15
votes
3answers
5k views

Pgfplots : can't plot some usual mathematical functions

I'm beginning to learn pgfplots and I would like to plot some functions: cubic root, inverse, and some trigonometric functions. The problem is that for y=1/x function, it joins up the points between ...
8
votes
1answer
486 views

Highlighting part of TikZ figure

I'm looking for a way to use transparency/opacity to highlight a particular area in a TikZ figure I generated. To be more specific, I have a TikZ figure that illustrates the relationship between ...
4
votes
1answer
998 views

Making chart grids be finer grained

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{tikz,pgf} \usepackage{pgfplots} \usepackage{slashbox} ...
9
votes
2answers
715 views

How draw “nested” mathemathical sets?

I want to represent mathematical sets of number (R,Z,N) using nested circles like this: This was very quickly created with gimp, but I am trying to do it properly in tikz but having some issue ...
0
votes
1answer
2k views

tikz automata edges overlap

I have two states positioned horizontally and need to connect them i.e. A -> B and A <- B, how can I position the edges in a way that they don't overlap and my diagram doesn't become a A <-> B ...
5
votes
1answer
1k views

tikz state initial with vertical orientation?

How can I change the orientation of the start arrow to come from the top instead of coming from the left as it is its default behavior. Can anyone advice using as base the TikZ State Machine example: ...
7
votes
1answer
695 views

tikz: Anchoring to rectangle split?

Is there an easy way I can anchor to the center of the second part of a rectangle split node? Here is what I am currently working on: \documentclass[letterpaper,oneside]{report} \usepackage{tikz} ...
2
votes
0answers
69 views

tikz matrix and beamer [duplicate]

Possible Duplicate: Unknown error using tikz matrix of nodes in beamer I would put the following figure in a beamer slide I tried with [ampersand replacement=\&] but it does not work ...
3
votes
1answer
301 views

Bringing the parts of a bar chart closer

In the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{tikz,pgf} \usepackage{pgfplots} \usepackage{slashbox} ...
10
votes
3answers
477 views

dynamic clipping plane with TikZ

i have a problem with TikZ. I'd like to draw a dynamic clipping-plane. the top of the red area is dynamic, the blue one should be the same high/level but much larger dimension... to seperate optical ...
3
votes
1answer
683 views

Set ticklabels for colorbar

With the risk of sounding foolish, but I can't seem to find the answer anywhere. How can I set the ticklabels for the colorbar? Let's say I have the following code: \documentclass{report} ...
4
votes
1answer
881 views

How to include arrows in a .tikz file, which is generated with matlab2tikz?

I made a plot with matlab. Then I generated a .tikz file with matlab2tikz. Now i want to insert arrows in the .tikz file and also write something left of the arrow. I can make arrows and text in the ...
2
votes
1answer
275 views

How to use listings inside pgfplots captions?

I need to add a (general) listings code in a plot caption. For some reason listings (inline) doesn't interact well with \addlegendentry, what can I do to make the same code work outside and inside an ...
2
votes
1answer
478 views

pgfplot barchart moving x-axis up

For the MWE below: \documentclass{report} \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{tikz,pgf} \usepackage{pgfplots} \usepackage{slashbox} ...