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)

4
votes
1answer
198 views

Coordinates of corner of histogram bar

How can one get the coordinates of the top right corner of a bar in a histogram? So far, I have just tried to make the lines fit... \begin{document} \usepackage{tikz} \begin{tikzpicture} \begin{axis}[...
7
votes
2answers
298 views

Combination of arrowed list and boxes in tikzpicture

I am trying to make a figure showing some info using tikz. At first it looked OK, but after a while everything had moved so nothing was aligned. I figured that there probably is a much better way to ...
1
vote
1answer
145 views

I want to organize three images in a frame, simulating the effect of a zoom,

I have three images, I want to organize them in a frame to cause the effect of a zoom, similar to the image I have posted above. In this image the galaxy is at left, but i want to learn how to ...
6
votes
2answers
1k views

Draw on background rectangle

I have the following code: \documentclass[11pt,a4paper]{article} \usepackage{tikz} \usetikzlibrary{backgrounds} \begin{document} \begin{tikzpicture}[framed, background rectangle/.style={draw=...
1
vote
1answer
368 views

configure dash length in circuitikz

I'm trying to manually set the dash length while using \usepackage{circuitikz}. I only know about the options \draw[dashed] or \draw[densely dashed] . But how can I get the dashes even shorter? Or ...
5
votes
1answer
270 views

How can I draw a relation with rectangular nodes?

I am trying to use nodes to draw a simple relation in two figures. Basically what I want looks like this: How can I do that using tikz? The two relationships should be next to each other. I think if ...
5
votes
3answers
689 views

Drawing and labeling the sides and angles of a right triangle

The following code instructs TikZ to draw a right triangle AQP with a right angle at Q. I mark the length of line segment AQ by y. How do I rotate by 90 degrees the letter y so that it is upright? I ...
2
votes
3answers
283 views

How to draw a rectangular cuboid with nodes on both sides

Could someone please help me to produce a pair of the following pair of objects: on the left hand side we have a rectangular cuboid (2x3x3 ''cube'') with nodes on both sides connected by dashed lines ...
7
votes
3answers
298 views

Is it possible to use beamer's overlay specifications in other documentclasses?

I'm writing an article that involves a lot of diagrammatic calculus, that is, there is a big TikZ picture with nodes and lines and that picture gets modified slightly in each step of the calculation. ...
1
vote
1answer
334 views

Get pre-defined colors into table in TikZ

I'm doing some plots in TikZ via matlab2tikz, which gave me the following output: \documentclass[a4paper]{article} \usepackage[dvipsnames]{xcolor} \usepackage{pgfplots} \usepackage{tikz} \begin{...
3
votes
1answer
162 views

Why can't I use a variable from a \foreach loop inside a calc library macro?

Question Why can't I use the \foreach variable as a percentage in my calculations with the calc library of TikZ? Sample Code In the following, I could replace the variable \mypercentage with an ...
19
votes
1answer
500 views

Length of curve in TikZ

Is it possible to compute the length of a generic curve in TikZ? An answer to this question would solve TikZ dashes and closed curves as follows: Let lc be the length of the curve and lp the desired ...
1
vote
0answers
25 views

tikz: wires not connecting up to the nodes [duplicate]

I don't know why the wires are not connecting upto the nodes (a) and (b). Can someone please help? Thanks in advance. \begin{center} \begin{tikzpicture}[circuit logic US] % The two gates \...
10
votes
2answers
490 views

TikZ dashes and closed curves

When a closed curve is dashed, the dash spacing at the start/end point can be very unfortunate. Is there an option to tell TikZ that it should slightly adapt the dash spacing to avoid such cases? (I ...
1
vote
0answers
53 views

Missing file error with Tikz intersections [closed]

I'm using TexPad for Mac, and I got stuck for the following error, how can I do? I've tried to install some package but it didn't work! Or at least I didn't find the right one!
5
votes
3answers
353 views

Help designing a TiKZ drawing

I've been using LaTeX for a long time, however I have never been into the TiKZ class, I need to create the following drawing, I only have to draw the boundary of the mesh and the dots (not the ...
6
votes
2answers
282 views

Use tikz spy in a scope in order to relatively adress points in two images/scopes

I am continuing the example I started here, and want to have two images in one picture being positioned relative to each other and using two scopes for the ´spies´. The following MWE includes a first ...
1
vote
0answers
121 views

pgfplots table read handle non-numerical entries

In a previous question, I asked how to create a Root Locus plot and got a pretty good answer thanks to @percusse using \pgfplotstableread that gets me 90% of the way there. However, the one thing I ...
3
votes
1answer
231 views

Tikz: Finding intersection of Brownian motion and circle

I'm trying to draw a two-dimensional Brownian motion started in a circle and now want to label the first exit time of the motion: \documentclass[parskip]{scrartcl} \usepackage{tikz} \usetikzlibrary{...
1
vote
1answer
157 views

TikZ: How to distinguish multiple vertices with the same id?

(Almost minimal) working example: \documentclass{beamer} \usepackage{tikz} \usepackage{verbatim} \usetikzlibrary{arrows,shapes} \begin{document} \pgfdeclarelayer{background} \pgfsetlayers{...
0
votes
1answer
68 views

Replace vertex in TikZ

I'm completely new to TikZ and took a look at an example graph: http://www.texample.net/tikz/examples/prims-algorithm/ For a presentation I need to replace a vertex by another vertex at a certain ...
2
votes
3answers
308 views

Plotted line in tikz stops in middle of grid

The plotted line stops and doesn't go on till the border of the grid: This is my code: \documentclass{article} \usepackage{tikz} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[...
2
votes
1answer
543 views

Align tikz picture on the right side of the screen, next to text

I want to have some code, and then on the right side of it a tikz picture. I tried 'flushright' but that didn't work. This is my code: \documentclass{article} \usepackage{amsmath} \usepackage{tikz} ...
3
votes
2answers
267 views

Effective potential with tikz

How I can draw a perfect picture of an effective Newtonian potential? I tryed, but it is not so good as I want. \begin{tikzpicture} \begin{axis}[ xmin=0, ] \addplot[ red, smooth, domain=-5:1, samples=...
3
votes
2answers
141 views

\texttt in decoration causes LaTeX to hang

I have the following code: \documentclass{standalone} \usepackage{tikz} \begin{document} \usetikzlibrary{decorations.text} \begin{tikzpicture} \path [->,decorate,decoration={raise=-5pt, text ...
7
votes
1answer
381 views

How to draw NO2 in LaTeX?

It would be nice if you could help me to draw NO2 in LaTeX. The figure should look like the example image. On this website is some information about the chemfig/chemmakro package. My code untill now ...
5
votes
1answer
554 views

Putting coordinate axes on a TikZ picture

I get the following error: Package pgf Error: No shape named Q is known. Without the \begin{axis} ... \end{axis}, the code is compiled but the images depicted is a jumbled mess. I intended to get a ...
2
votes
1answer
343 views

Horizontal decision tree in TikZ

I've been looking for a TikZ example for a while now that looks something like the attached powerpoint picture. I can't imagine that nobody has done something similar. I tried adapting this example, ...
2
votes
0answers
128 views

Can I reduce the timeout for compilation?

I'm writing a document with many pictures using the tikz package. A small error in these often do not make compilation fail outright, but rather time out. (Example from https://www.writelatex.com/help/...
-1
votes
1answer
496 views

draw pair of scissors in tikz [closed]

Is there someone who can help me to draw a pair of scissors in latex? The picture below is good enough. I have no problem with constructing the rings, but I don't know how to make the "body"? I have ...
1
vote
0answers
215 views

How can I draw Indian horoscope charts? [closed]

I was wondering if Indian horoscope charts can be drawn in LaTeX. Here is one example: It has 12 divisions. And in each of the divisions there may be one or multiple Grahas with their corresponding ...
3
votes
1answer
136 views

How to make a function inside the tikzpicture behave like outside

I have a macro which generates a structure (rule) and a reference to that structure. It does not behave when inside a tikzpicture. How to make the function robust to reference the structure even when ...
4
votes
1answer
516 views

Homework Problem Sheet Template

Could someone make this picture of Homework Problem Sheet Template in sample code in LaTeX with the same font size by the way i already add tow pictures in the front of document to make it more cute ...
1
vote
1answer
129 views

Drawing Vertical Plots

is there any quick way to draw vertical plots with pgf-plots? I need to draw successive vertical lines for the plot below: \begin{center} \begin{tikzpicture} \begin{axis}[ clip=false, ylabel={}, ...
1
vote
1answer
120 views

Adjust edge endpoints depending on node label

I would like to draw a tree where the position of edge endpoints relative to the node depends on contents of the node, and may change between the parent edge and the child edges, to point out a ...
3
votes
1answer
326 views

How to group nodes of an automaton with tikzpicture

I want to obtain this result: and so far I've written this code: \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{automata,positioning} \begin{document} \begin{tikzpicture}[% >=...
4
votes
2answers
231 views

How can I add more coordinates to standard TikZ shapes?

Question I would like to know how to add an arbitrary number of coordinates to the default shapes of TikZ—particularly to the side of a polygon. Sample This is similar to http://tex.stackexchange....
5
votes
2answers
362 views

font size with tikzset and tikzscale not working

I want to set the font family and size for all pgf/tikz figures in my preamble. But when I use tikzscale, then this is ignored. Can anyone help? \documentclass[a4paper,12pt]{scrbook} \usepackage[...
6
votes
1answer
96 views

Equivalent to “shorten <=” for intermediate points

Halo everybody, I try to plot a data set using tikz & pgf. I want that the points in the plot are connected, but the line shouldn't touch the points. I can achieve this for the first and the last ...
4
votes
1answer
152 views

Graph doesn't stay within grid

I've plotted two simple functions in Latex using tikz. It looks like this: As you can see, the curve doesn't stay within its grid. How can I fix this? This is my code. I'm using documentclass '...
4
votes
1answer
300 views

Mutiple composable styles for a tikz node using “append after command”

I'm trying to build a little drawing library in which each node will have the same base, but can be annotated with various options which will cause extra things to be drawn in/on the node. I'm ...
5
votes
1answer
682 views

Complex function plot using TikZ or PGFPlots

I need to plot some steps of this approximation http://mathoverflow.net/a/27127 but don't know how to start.
2
votes
2answers
238 views

How to combine a top-down and bottom-up binary tree in one picture?

I want to draw a binary tree like the one in the picture below. Unfortunately, I do not have any clue, whatsoever, on how to draw two trees from top and bottom to match their leaves. Any help would be ...
3
votes
3answers
341 views

How to get coordinates going from 0 to 1 in tikz image

I'm trying to create a cover page with a background image filling the entire page. On top of that in the lower third of the page should be a transparent rectangle going from side to side and on top of ...
4
votes
3answers
214 views

Change line shape on TikZ

I'd like to draw a diagram of a long exact sequence. This is what I have done: \documentclass{beamer} \usecolortheme{wolverine} \beamertemplatenavigationsymbolsempty \usepackage{tikz} \usetikzlibrary{...
6
votes
1answer
347 views

How to make right angle mark in geometry 3D like this picture?

I want to mark right angle. I tried in Geogebra \documentclass{standalone} \usepackage{pstricks-add} \begin{document} \psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dotstyle=*,dotsize=3pt 0,linewidth=...
4
votes
1answer
160 views

Wrong spacing of circled numbers using Tikz and exam class

I am using XeLaTex. I am also using the package exam. I am preparing a multiple choice test, but I have no Scantron and I want students to tick the desired circled answer by pen. This is the relevant ...
2
votes
1answer
215 views

How to get two data series in tikz plot?

How do I create a second data series from the code below? I have tried separating the two curves with curly brackets but it was not the correct code. \begin{figure}[h!tp] \centering \...
1
vote
1answer
98 views

How to make this bar plot visible?

I am trying to visualize about 21 data points, each which gives a different value for 3 different tasks, so there are 63 unique values to plot. I have tried using pgfplots colored bar plot, but I ...
8
votes
1answer
2k views

Enumerate within TikZ node

Compiling the following code with pdflatex: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[remember picture, overlay] \draw (current page.center) node { \...