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)

5
votes
1answer
2k views

Tikz-pgfplots and matlab2tikz doesn't capture subplots well

I use matlab2tikz to convert this matrlab figure: % This file was created by matlab2tikz v0.3.3. % Copyright (c) 2008--2013, Nico Schlömer <nico.schloemer@gmail.com> % All rights reserved. % ...
3
votes
1answer
1k views

Problem with Texmaker and TikZ

I have a problem with TikZ and Texmaker. I would like to know why Texmaker doesn‘t work with the command: \draw [->] .... inside the environment tikzpicture. I don’t know the reason, maybe I ...
3
votes
1answer
1k views

TikZ externalize fails to recognize changes [duplicate]

Using XeTeX(xelatex) [i got the same using pdflatex] on Debian I am trying to save some compilation time using tikz external. Yet, the figures are never updated unless I delete the corresponding ...
21
votes
3answers
905 views

Best way to illustrate Keplers 2nd law with tikz

I am trying to visualize Keplers second law of planetary motion with tikz. I managed to do the following: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} ...
4
votes
1answer
294 views

problems with tikz and arabi package

I have some problems and I hope you can help me. When I put a tikzpicture and use the arabi package, the picture is not displayed in the dvi or pdf file, and this without a single error. I have a ...
3
votes
1answer
248 views

using TikZ with multipage table

I am using tikz files to insert figures . I would like to add 3 figures one after the other with the same figure caption: I use this code: the problem is that the last figure is at the bottom of the ...
3
votes
0answers
189 views

Magnified plot / Vertical Markers [duplicate]

I've been trying to use the spy library to magnify a part of my plot, but I don't really understand how it works, and I can't find a manual/tutorial anywhere. Right now I am doing something based on ...
1
vote
0answers
250 views

Making Diagrams in TIKZ [closed]

I am making a diagram of a cellular reaction pathway and I'd like the chain of reactions to be surrounded by a large circle, which will of course be the cell membrane. For the life of me though, I ...
9
votes
1answer
2k views

Energy level diagrams with TeX

Do you have any experience with creating energy level diagrams with TeX as shown below ? What software/packages would you recommend me ? I've heard about TikZ, but I don't have any experience with ...
2
votes
0answers
56 views

Error with $ when using math in TikZ figure [duplicate]

I am drawing some figures with TikZ for a beamer presentation. I want one figure to look something like this: Additionally, I want to add labels under the intervals (the sections in between ticks ...
6
votes
2answers
322 views

TikZ: add “alt tag/caption/invisible text” for accessibility

I'm using this amazing tex.sx answer tikz star macro for rendering a x-out-of-y stars graphic for my skills on my resumé. The resume is done with xelatex and exported to pdf. Because it is a resumé, ...
2
votes
0answers
96 views

Brownian Motion [duplicate]

everybody! I need your help, I'm struggling with the visualization of the Brownian motion and would like to reproduce the following graph: I have already found a similar topic (How to draw Brownian ...
6
votes
3answers
2k views

Circular arrow in 3D to indicate a unit axis rotation

I would like to indicate the directions of rotation and symbols used for the respective Euler angles. This would look nice using small circular arrows around the axes, as shown below: In this ...
6
votes
1answer
1k views

How to decorate a line with arrows and circles

I would like to draw an arrow (ray of light) overlayed with perpendicular double headed arrows and circles (to show both s & p polarisation), but I am struggling with decoration commands. I have ...
26
votes
4answers
3k views

Fill of a thermometer

The objective here is to create a fill of the thermometer to a desired degree being this in Celsius or Fahrenheit. Of course optimizations in the code below are welcomed like how I create the labels ...
3
votes
2answers
439 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 ...
4
votes
1answer
1k views

tikz markers in a math equation of a node

I realize this is almost certainly impossible; however, I would love to see the TeX wizardry hidden here (and I actually also really desperately want this feature). So I have a tikzpicture, and ...
10
votes
2answers
5k views

Is is possible to rotate text using nodes near coords?

I'm plotting a ybar, and nodes near coords is ugly. Is it possible to rotate the text above the bars by 90? \begin{tikzpicture} \begin{axis}[area legend, legend pos=north west, legend columns=4, ...
3
votes
1answer
208 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 ...
9
votes
3answers
2k views

Draw a path between many nodes using foreach

I'm running into a weird problem here... I have very many nodes defined, and I would like to draw a path from the first to the last using foreach. But, when I try, it just draws edges between p1 and ...
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
111 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} ...
11
votes
1answer
7k 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
1k 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) ... ...
0
votes
1answer
292 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:
6
votes
1answer
581 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} ...
6
votes
1answer
293 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 ...
11
votes
1answer
890 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 ...
4
votes
0answers
429 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
352 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 ...
18
votes
2answers
11k 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 ...
5
votes
1answer
2k 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 ...
7
votes
2answers
345 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 ...
1
vote
1answer
147 views

How to fix layering with the 3d package?

I used the 3d TikZ library to draw a circle in the z-y plane around a line along the x axis. But since the circle is drawn on top of the line, it does not look like the line passes through the circle. ...
6
votes
1answer
2k views

Setting camera projection angle in tikz to enhance the depth perception when drawing 3D figures

First please see the following example using MATLAB drawing command >>surf(membrane); We can adjust the camera angle using MATLAB's built-in command camproj, the effects are as follows: ...
8
votes
2answers
7k views

Self loop in an undirected graph using TikZ

How can I create a self loop without a direction on the edge? \path[every node/.style={font=\sffamily\small}] (3) edge[loop] node {$e_{1}$} (3); creates the loop I want but has a direction.
1
vote
0answers
38 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 ...
3
votes
1answer
1k 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 ...
17
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 ...
5
votes
2answers
386 views

Parallel loop [python-like zip] in Tikz

An easy way to write axis labels in Tikz is: \foreach \x/\xtext in {-1,-0.5,0.5,1} \draw[very thin,gray] (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north] {$\xtext$}; Is it possible to have something ...
7
votes
2answers
763 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} ...
2
votes
1answer
274 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} ...
17
votes
2answers
3k 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 ...
2
votes
3answers
360 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
1answer
141 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 ...
3
votes
2answers
131 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$ ...
13
votes
1answer
4k 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 ...
0
votes
1answer
319 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 ...
3
votes
3answers
960 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 ...
2
votes
1answer
1k 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} ...