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)

7
votes
1answer
486 views

Different radii of rounded corners in same draw command in TikZ

Is it possible to use different rounded corners radii on different parts of a draw command? I'm creating a tube that is bent. I'd like the outer radius to be greater than the inner radius. I can of ...
7
votes
2answers
2k views

Easy creation of logarithmic grid with TikZ

Is it possible to create a logarithmic grid using the command below with TikZ? \draw (-0.1,-0.1) grid (4.1,4.1); It would be great to be able to create a logarithmic grid without having to specify ...
4
votes
1answer
234 views

TikZ node in normal text

I would like to place a TikZ node inside normal text to get the fancy boxes. But the box is on the same baseline. I would like to get the text on the baseline. What can I do? \documentclass{article} ...
13
votes
7answers
2k views

Transform defined coordinates in TikZ

Say I have a triangle with vertices defined using \coordinate (a) at (0,0); \coordinate (b) at (1,0); \coordinate (c) at (0,1); Let us denote by T(x,y) the triangle defined by (a),(b) and (c) which ...
5
votes
2answers
559 views

Horizontally align the dots in two dotted lines

I'm trying to draw two loosely dotted lines, one with slope 0 (i.e. a horizontal line), the other upward sloping. Is there a way to horizontally align the dots in these two lines? Here's a MWE. ...
7
votes
1answer
298 views

Problem of superimpose and how to change legend symbol

Given the plot as follows I have two problems: a and b are superimposed on each other, how should I make this clear on the graph? How could I change legend c to other icons like star? (It looks a ...
7
votes
1answer
149 views

Equivalent of pstricks command \psecurve in tikz

What is the equivalent of the pstricks command \psecurve in tikz? The yellow line is the \psecurve. It's basically the same as the \pscurve: the curve is defined by all the named points, but is not ...
8
votes
3answers
1k views

How to draw a rectangle filled with random size circular pattern?

I wish to generate a rectangle with circular features present within (to represent water particles), something like this: Which shows that the incoming radiation decreases with distance (as ...
6
votes
3answers
505 views

Ellipse with eigenvectors and eigenvalus in tikz

I'm trying to make ellipse with eigenvectors and eigenvalues in tikz. I'm having tough time with managing my braces. I wonder if there is any analyticall approach to adjust braces. Thanks ...
8
votes
1answer
294 views

Shorten both ends of a line with one key

Consider the following snippet: \begin{tikzpicture} \def\ptRad{2pt} \fill (0,0) circle (\ptRad); \fill (1,1) circle (\ptRad); \draw[<->, shorten <=\ptRad,shorten >=\ptRad] ...
3
votes
1answer
463 views

Alignment horizontal subcaption and TikZ

I have a problem with the alignment of 2 plots. The Problem is I want the captions to be horizontal aligned. Also the x-axis should be horizontal aligned! Is there a way to do that? ...
2
votes
1answer
690 views

How to draw a horizontal line between middle of the page and one of the edges (in beamerposter)

I have a two column layout with beamerposter, where the columns are seperated by a vertical (thanks to egreg). Now I need the sections to be divided by horizontal lines that range from the edge of the ...
11
votes
2answers
2k views

How do I generate a logarithmic x-axis without a y-axis?

I would like to plot the following image using TikZ: How do I generate an X-axis with logarithmic scaling using TikZ? For linear scaling I use this code: \usetikzlibrary{plotmarks} %axis \draw ...
5
votes
1answer
286 views

Thick and patterned arrows

I am trying to get an arrow that is thick but not entirely black but has a pattern (e.g., crosshatch). I am not sure how to get this. I have the following that still gives me a black arrow: ...
14
votes
2answers
2k views

TikZ - diagram of the sun

I am attempting to generate the following diagram: I am finding it difficult to place all of the triangles surrounding the center circle in the manner shown. Currently I can place four of the 8 ...
5
votes
2answers
698 views

hf-tikz doesn't box around equation

In TikZ based \boxed construct is causing pdflatex to hang it was suggested to use hf-tikz instead of manually using tikz. The documentation indicates that this package doesn't work properly for tall ...
7
votes
2answers
286 views

Using foreach loop in TikZ to plot at non-uniform locations

As a Teaching Assistant for a class, I am trying to draw a seating chart for the professor. The seating chart will have a photo of each student, the student's name, and where the student is sitting in ...
9
votes
1answer
347 views

A hitch in my animation and tikz document

There's something strange going on with the animation at 135 degrees. I can't figure out what's going wrong. Here's the MWE: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} ...
7
votes
1answer
460 views

Drawing a 3x2 rectangle

I am trying to draw a 3x2 rectangle. I am not sure if multipart rectangle can do it, but it seems that multipart can only do one-dimensional arrays. I tried matrix, but then I cannot get the lines in ...
3
votes
0answers
60 views

tweaking the positioning of tikz arrows (such as on a curved path) [duplicate]

I believe that this is a duplicate of a question/answer posted within the past two months. But, after much searching, I still can't find it. Does someone out there know the link? My question I'm ...
6
votes
3answers
363 views

Aligning image and text in new command in TikZ

As a Teaching Assistant for a class, I am trying to draw a seating chart for the professor. The seating chart will have a photo of each student, the student's name, and where the student is sitting in ...
1
vote
0answers
307 views

pgf-umlsd and externalize [closed]

What would be the best solution to make pgf-umlsd and externalize compatible? The latter expects \end{tikzpicture} which is "hidden" within sequencediagram environment the first provides. I guess I ...
5
votes
1answer
521 views

Syntax error using PGF math function in coordinate

I would like to avoid setting too many of the values for the following picture too rigidly. For example, I would like to be able to set the position of point A and forever after that be able to ...
1
vote
1answer
125 views

Arrows underneath numbers (Part 2 question)

I need the code for arrows underneath numbers going in the right direction. I've looked up the commands online and all I have \uarrow which goes to the left and not right.: Thank you Hendrik. My ...
0
votes
0answers
72 views

Plotting a curve with different colors [duplicate]

Plotting a curve with different colors between points which you try to connect smoothly by one curve.
5
votes
1answer
371 views

tikz coordinate calculations gone wild

I'm quite a bit baffled why my coordinate calculations are coming out so differently. All coordinates are where I expect them to be, except coordinate Z. \documentclass{article} \usepackage{tikz} ...
9
votes
3answers
499 views

How to draw two intersecting graphs?

I want to make the following figure. My efforts are: \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{calc,shadings} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
3
votes
1answer
329 views

How can I draw two lines to a block?

I'm trying to draw a control block, but I got problem to connect two input to a block How can draw a line from the u1 to the estimator without drawing on the estimator block? This is what I tried ...
11
votes
1answer
278 views

Increase the arc in a TikZ arrow

This question is a spin-off from TikZ arrow misaligned in italicized text. I'm drawing an arrow from one character to another within a word, using TikZ's \path edge[]. But the arrow's arc is so flat ...
5
votes
1answer
338 views

TikZ arrow misaligned in italicized text

Based on the questions How can I draw arrows between words in linguistic examples? and Add arrow pointing from one table cell to another, I'm trying to draw a curved arrow from one character to ...
1
vote
0answers
193 views

How to bring beauty to this pgfplot? [closed]

We are making a plot as follows: \documentclass{standalone} \usepackage{pgfplots} \usetikzlibrary{calc,shadings} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \def\xmin{0} ...
3
votes
0answers
171 views

How to vertically align the captions for sub figures in subfigure? [duplicate]

This is my tikz code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,shapes.geometric,arrows,fit,calc,positioning,automata,} \usepackage{amsmath} \usepackage{caption} ...
6
votes
1answer
833 views

How can I add a component to circuitikz?

Similar to CircuiTikZ — create new component I am using circuitikz to create an electric circuit diagram. I have found the preset symbol for the zener diode to be different to the symbol I wish to ...
8
votes
1answer
316 views

Automatically place right angle indicator on normal vector

I'm trying to draw a normal vector on a curve, and use the usual "dot in an arc" symbol to indicate that. Here is what I have so far, which looks alright, but needed manual adjustment of angles and ...
23
votes
2answers
2k views

Does TikZ support interactive animation?

I am plotting a function y = a*x^2 with a is variable constant. I would like to control a interactively but I google and seems that TikZ doesn't support interactive operation. Also, I want to know ...
5
votes
1answer
262 views

Highlight elements in the matrix (continued)

Using @Stefan Kottwitz's solution of Highlight elements in the matrix, is it possible to select one single entry in the matrix? Where does one need to place the left and the right marks?
4
votes
1answer
483 views

how to add dotted line and arc line?

I wish to add dotted line connecting two nodes and an arc line as described in the photo. Here is my code: \documentclass[tikz]{standalone} \usetikzlibrary{ shapes.geometric, positioning, ...
1
vote
0answers
131 views

TikZ based \boxed construct is causing pdflatex to hang [closed]

In standalone code this works for me, drawing a nice red colored box around my equations (based on TikX \underbrace like replacement that I use without any trouble): \documentclass{article} ...
6
votes
1answer
954 views

tikz label coordinates using mathematical expression from foreach variables

\documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x [count=\xi from 1] in {-3.0,-2.8,...,1.8} \draw[thin] (0,0) ++(\x,2) rectangle ++(0.2, 0.2) ...
3
votes
1answer
73 views

How to adust the location of the inner component in the Outer component constructed by “fit”?

I use "fit" to make two small rectangles inside a bigger rectangle. And then add some words at the top of the bigger one, which causes a large blank space at the bottom of the bigger rectangle as ...
5
votes
2answers
445 views

uncover chemfig molecule (in beamer)

I teach chemistry and wish to demonstrate drawing and naming of chemical structures I use chemfig to draw my molecules and I can do that fine. However, in for example the molecule ...
3
votes
1answer
266 views

generate schematic diagram with shapes and curved path

I wish to generate the following figure: So far I have managed: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \begin{tikzpicture}[transition/.style = ...
2
votes
0answers
140 views

Creating an invitation printable matrix [closed]

I'd like to create an 'invitation matrix' which will be printed on both sides of A2 or A3 paper and looks like this: |front_11|front_12|...|front_1n| |back_11|back_12|...|back_1n| ...
1
vote
0answers
63 views

how to set the size of the star? [duplicate]

I wish to draw the picture described How to add the circle, star inside the diamond? I tried the code: \node[draw, fill, star, star points=6, minimum size=0.1mm,above=of aux, anchor=center]{}; ...
4
votes
2answers
217 views

Why does loading tikz before calling “driver=dvips” make a difference

This question doesn't entirely make sense because I know I don't need to call driver=dvips. But I would like to know whether anyone can explain what's happening. A little background I'm trying to ...
4
votes
1answer
159 views

How to add new line character in the node

I wish to add the new line character in the node, however, I tried several ways, all cannot work. \node[draw, minimum width = 2em, minimum height=1em] (a) {get \\ flight(gf)};
12
votes
3answers
472 views

How can I draw a diamond with a cross in the center?

I wish to draw the cross diamond, however the line of the cross is inside the diamond, like described in the picture. However, I tried the code below, the result is \node[draw, diamond, below=of ...
5
votes
1answer
252 views

Label beside line before a branching node in a TiKZ “tree” chart

I'm very, very new to TiKZ. I'd like to make the (very crude) following diagram with TiKZ: Start | | Process 1 | / \ / \ / \ Item Item | | ...
4
votes
1answer
967 views

How to draw array (data structure) and show partition?

I'm doing a homework for algorithm class where I have to show what a particular array looks like at each step of the quick sort algorithm, in a manner similar to this image: (page from CLRS book). ...
10
votes
2answers
155 views

Place a background relative to the position of an environment

I am trying to place a background that extends the entire page width and whose height depends on the height of the environment contained. For example, the following code provides something to what I ...