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)

8
votes
2answers
503 views

Highlight and use arrows in an equation In a robust manner

I am trying to give a very simple analogy to what I am trying to do with LaTeX. I simply want to write two vectors, one below or next the other, and then, use nodes to link the last two elements of ...
9
votes
1answer
253 views

Problems at page boundaries trying to highlight `\lstinline`

I was trying the code given in Colored background in inline listings, which is actually the same than in How to redefine \lstinline to automatically highlight or draw frames around all inline code ...
5
votes
1answer
101 views

Tikz: how to create a line in the center of the picture to the right of a node?

Code: \documentclass[12pt]{standalone} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{positioning, calc, decorations.pathreplacing,} \begin{document} \newlength{\distance} ...
3
votes
1answer
932 views

Importing .mat file to pgfplots

I am using pgfplots to create figures, and I have a (large) set of simulation data generated from Matlab. It is in the .mat format. The data are of the form (two column) (1,0.2) (1,0.3) ... ...
5
votes
2answers
473 views

TikZ: Combining multiple paths in and outside foreach

I am trying to generate a path from a list of directions (as seen on the numpad). The coordinates are generated correctly, but because I use multiple call to \path the arrowheads are drawn on each ...
3
votes
1answer
184 views

TikZ & External: figure re-created for no apparent reason

I'm having an issue where only one out of multiple figures is recreated despite the use of the tikz/external library. I've created a MWE which shows the same effect with only two figures. Below is my ...
3
votes
1answer
2k views

Hide Tikz node in Beamer

I am using Tikz to create a flow chart for a Beamer presentation. I managed to get Beamer to uncover each item in the flowshart one by one, but I would like to be able to show one node and then hide ...
5
votes
1answer
353 views

Style of combs in pgfplots

I am using pgfplots to create comb figures such as the following. \documentclass{article} \usepackage{pgfplots} \usepackage{xcolor} \begin{document} \begin{figure} \centering \begin{tikzpicture} ...
5
votes
1answer
248 views

Fill the background of functional groups in chemfig

I want to fill the background of some functional groups or atoms including bonds to emphasize them. For instance, to emphasize carbonyl group in a keton, fill the background of C=O like: I'm using ...
0
votes
1answer
250 views

Specific drawings with arrows and vertices in latex

I would like to know how I can create the drawings from page 7: and page 9 from the following article:
11
votes
1answer
630 views

Adding dimensions to TikZ pictures

How do you add dimension labels to TikZ pictures? Ideally, it would look something like this: |<----- dimension ----->| I would like to do this to show the measurement of both straight lines ...
12
votes
2answers
6k views

Positioning TikZ pictures

How do I position a TikZ picture relative to body text? I have drawn a circle using TikZ and would like to position it to the side of the body text (so it is easy to see as you're reading, but not in ...
9
votes
2answers
371 views

Drawing a wordnet with TikZ

I try to use TikZ to draw a wordnet like this but I really don't know what to start with. Can anybody help me with drawing this graph? Unfortunately, I don't have enough time to read books about ...
4
votes
0answers
401 views

Creating plots in Latex - easy to learn? [closed]

I am currently working on my summer project for which I created the following plot with Mathematica: Now I am not 100% satisfied with the results and one of my professors recommended PGF and TikZ. ...
2
votes
3answers
259 views

get the width (in pt) of a box

I would get the width (so a dimension) of a string in a box. I need to know the width of \hphantom{some text}, in order to use it into a tikz picture, for example as \draw (0,0)--(\mylen,0); that ...
11
votes
2answers
6k views

Histogram with Tikz

I am a newbie in TeX. And I need to use Tikz to make a copy of this histogram Of course, I am able to make something similar. Unfortunately, I need a replica (90%) of it. Can anybody help me? ...
5
votes
1answer
1k views

Display Database Instance Relationship with TikZ

I'm trying to display all of my corporate database instances and their relationship to each other, so to speak the database links. I found the geometry shape cylinder using TikZ ...
3
votes
2answers
385 views

TikZ frame paragraph span across pages in ConTeXt

I tried to reproduce the following example in ConTeXt: http://www.texample.net/tikz/examples/framed-tikz/ How can I substitute the LaTeX framed package, that is make the frame span across multiple ...
1
vote
0answers
37 views

Is there a way to use a previous TikZ picture? [duplicate]

Let's say I spend some time drawing this picture: And after a few paragraphs I want to draw the same picture plus some "spices". Of course I could just copy-and-paste the code, then edit the few ...
7
votes
2answers
514 views

TikZ: \foreach in macro with argument as list

The code below generates: What I expect is: Why does the \foreach seem to treat the entire list as one value? How do I fix it? \documentclass{article} \usepackage{xparse} \usepackage{xstring} ...
7
votes
1answer
4k views

Draw crosses in tikz

If I do \draw (1,1) circle (1pt) tikz draw a little circle with diameter 1pt at (1,1). How can I define a path cross such that \draw (1,1) cross (1pt) draws a little cross with diameter 1pt ...
3
votes
1answer
365 views

Tikz rectangle shaped arrows

I have a problem with the placement of labels on "rectangle shaped" arrows. I would like to place the labels middle and most right or left on the most right and left arrows respectively. Does anyone ...
2
votes
1answer
232 views

Error compilation tikz, intersection & foreach

I want to compile this code (using PDFLaTeX) \documentclass[12pt]{article} \usepackage[ansinew]{inputenc} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{color} ...
16
votes
5answers
1k views

Drawing a large binary matrix as colored grid in TikZ

I have a pretty big binary matrix of maybe 70 rows and 64 columns. For ease of viewing, I would like to draw this matrix in TikZ where e.g. a 1 is represtented by a red square and a 0 is a white ...
3
votes
1answer
118 views

Match coordinate in two different scopes

I've many small pictures, each centered at (0,0) in their own figure but i need to combine them and in the combined picture the (0,0) of the 1st picture (in a scope) should be (4,2) of the 2nd picture ...
11
votes
1answer
2k views

TikZ: \newcommand with optional TikZ options

I want to create a new command with some default TikZ options that you can override using an optional argument. If working as intended the code below would generate a red line between A and B, and a ...
10
votes
3answers
726 views

TikZ: two ellipses in different planes

How can show that two ellipses are in different planes? \documentclass[convert = false, border = 1cm]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} ...
0
votes
1answer
187 views

Tikz output changes (coordinate offset) when used in a class

I'm a beginner at Tikz, and have tried to create a good looking master slave d-flip flop to be used in my thesis document. The good output looks like this: The code used to generate the picture ...
93
votes
1answer
20k views

Manual/automatic line breaks and text alignment in TikZ nodes

How can I insert a line break in a TikZ node? Simply putting \\ where I want the break doesn't work (see MWE). Is there a way to make lines break automatically at some specified width? And can I ...
3
votes
2answers
120 views

TikZ: is there a better way to represent the following node content [duplicate]

Consider the code below: \documentclass[convert = false, border = 1cm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[font = \scriptsize] at (-3.5, 4) {Position of $S_2$ ...
3
votes
1answer
845 views

Plot alignment using groupplot in pgfplots

I am using the groupplots library in pgfplots to create plot groupings. I am using the 2x2 sizing but only have 3 plots. How can I center the furthest right plot vertically, to make a triangle rather ...
2
votes
1answer
177 views

Why doesn't standalone accept my build={} package option?

I frequently use standalone to incorporate tikz images in my documents. I have some really large tikz plots which I would like to include in my beamer presentation, but I am getting "Tex capacity ...
2
votes
1answer
622 views

Multiple arrows between nodes

This is my code: \documentclass[a4paper,10pt]{article} %\documentclass[a4paper,10pt]{scrartcl} \usepackage{tikz} \usetikzlibrary{shapes,arrows,fit,calc,positioning,automata} ...
3
votes
1answer
248 views

pgfplots memory overload

I want to plot 5x9000+ data points. I am already using: \usepgfplotslibrary{external} \tikzexternalize and -shell-escape -enable-write18 in PDFLatex. However, I still get the memory error. I ...
2
votes
3answers
265 views

wrapfigure inside a tikzpicture

I am trying to place a figure environment inside a tikzpicture as: \begin{tikzpicture} \node [mybox] (box){% \begin{minipage}{0.45\textwidth} % \LHead{ ...
3
votes
3answers
618 views

Can we use functions to compute coordinate X and Y in a tikzpicture?

I would like to compute coords X and Y to build a figure : \documentclass[a4paper,12pt]{book} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{tikz} % pour dessins ...
3
votes
1answer
144 views

Special Axis Style Customization

I want to design a special axis label style. The x-axis is a straight line, no arrow. Below the end of this line is the actual label, it consists of an arrow with the label in the middle of the arrow. ...
-1
votes
1answer
3k views

How to make this diagram in latex

Please could someone make this diagram in LaTeX and if you have some other thought to make it better than I draw it I'll be grateful. Here is how figure 1 and 2 Thanks to Mr John Wickerson who ...
1
vote
1answer
816 views

TikZ: using the -latex arrow head in decorations.markings

Is there a way to get -latex arrow heads to work when using decorations.markings? \documentclass[convert = false, border = 1cm]{standalone} \usepackage{tikz} \usetikzlibrary{calc, arrows, ...
5
votes
1answer
272 views

mdframed: unable to reproduce the example environment with figures [duplicate]

I used mdframed but I am unable to reproduce the example environment (?) from this primer. The main problem is with figures (graphics, plots), of course. Any help?
7
votes
2answers
317 views

Rotate an arrow around its center

I want to draw this with tikz, I have been trying to do it with tikz for awhile but didnt get far, with suggestion I moved to PsTricks. This is what I have so far ...
2
votes
2answers
179 views

TikZ: can a new coordinate be placed along a line by using shorten?

I have line from the origin to (2,2) in this example where I placed the coordinate (A) at the (2,2). What I want to do is place a new coordinate 1cm below (A) on the same line and then draw a ...
5
votes
1answer
540 views

TikZ: using filldraw with the let in syntax

How can I get \filldraw to fill the wedge when I use \filldraw let .. in syntax? \documentclass[convert = false]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} ...
1
vote
2answers
536 views

MWE for externalize + automatic recompilation after tikz figure modification

I am using the external library to avoid recompiling tikz figures unnecessarily in a large document. Every now and then I have to change some details of some selected pictures. After the modifications ...
5
votes
1answer
186 views

Legend position in standalone pgfplot moves when plot is used in document

The following mwe shows that the legend position in a pgfplot changes when the standalone version is scaled in a document that includes it. Standalone: From driver: (I changed the sizes to ...
7
votes
2answers
561 views

How to update an existing node?

I'm drawing a node and after a \pause I'd like to add a label to the node. What I have so far simply repaints the node, but I hope that there is a nicer way: ...
4
votes
1answer
320 views

Latex Block diagramm / draw Range

I want to use a Block diagram like in this document on page 9: http://texdoc.net/texmf-dist/doc/generic/pst-bar/pst-bar-docDE.pdf But I fail at doing this. At the moment I am using this: Grouped bar ...
3
votes
0answers
535 views

TikZ: scaling the tikz picture environment

If I scale the TikZ picture environment, everything should scale by a factor of x correct? If that is the case, why would some code not scale or scale incorrectly when it is in the environment? For ...
8
votes
1answer
237 views

TikZ: using the draw let in syntax to create an arc but the arc and its difference angle doesnt add up to 360

Consider this code snippet: \draw[-latex] let \p0 = (P6), \p1 = (P5), \p2 = (P4), \n1 = {atan2(\x1 - \x0, \y1 - \y0)}, \n2 = {atan2(\x2 - \x0, \y2 - \y0)}, ...
1
vote
1answer
176 views

Tikz, childs not exactly on the same level

I'm having trouble arranging my child nodes. They don't seem to be centered, horizontally, if use the anchor=north setting. It looks like they are arrange according to their top edge of the node, but ...