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)

23
votes
0answers
2k views

TikZ library for Computer Science

Is there a Computer Science library for TikZ? I am looking for a library for drawing standard data structures (array, linked list, stack, queue, pointers, trees, etc) in a consistent way. I would ...
16
votes
0answers
254 views

Did one manage to get the new dvisvgm driver from PGF 3.0 to work?

Background: PGF 3.0 added a new, direct way to create SVG. It now has a dvisvgm driver (pgfsys-dvisvgm.def) which has fewer (claimed) limitations than the pgfsys-tex4ht.def driver. Except it doesn't ...
14
votes
0answers
313 views

How to draw topological surfaces?

I am making some notes on differential geometry and topology lecture. As I know in LaTeX we can draw some very nice images. But I was not able to find any examples on surfaces, which I could use. Is ...
14
votes
0answers
167 views

Put Gnuplot mutiple surfaces plot in PGFplots axis environment to overcome z-buffer problem

Although PGFplots is the perfect tool for many depictions, it unfortunately does not have a properly working z buffer for intersecting surfaces (at this time, 10-09-2015). I'm trying to overcome this ...
14
votes
0answers
305 views

Is it possible to produce a context free grammar for Tikz path? node?

Even further, I would be happy to see a definition of the tikz language in the usual manner programming languages such as Java and Pascal are defined. The reason I ask is that I keep getting ...
12
votes
0answers
102 views

Wrong marginnote positions inside a tikzpicture with XeLaTeX

The marginnote package offers the \marginnote macro. I use this inside a tikzpicture environment to place notes into the margin. While this works without problems when compiling with pdfLaTeX, this ...
10
votes
0answers
93 views

Is there a general rule when to write pgfplots keywords together?

When using tikz especially pgfplots I find it often difficult to remember if a keyword is written together or separaded. Examples for keywords written together are: xticklabels enlargelimits ...
10
votes
0answers
454 views

How to exclude or remove weekends from ganttchart

Hi there and sorry for the incomplete question which only a psychic could answer :-) My problem is that I want to have my nice ganttchart or time schedule, but without including weekends. As my ...
9
votes
0answers
156 views

Branch TikZ graph always on the same side

I am trying to draw a graph (actually, generate TikZ code automatically) which has a main branch that must be straight; secondary branches must always branch on the left. On each layer there must be ...
9
votes
0answers
82 views

Passing special characters to “shorthand” x+y options in TikZ

Update: this is now a bug report on sf.net. I think I understand the rules for special characters in pgfkeys key arguments: If it contains any of {,, =, ]}, it must be protected by putting the entire ...
8
votes
0answers
104 views

\selectcolormodel{gray} not applied to \draw

Today I found something weird. When I use \selectcolormodel{} in a TikZ drawing the model is only applied to \fill and not to \draw[fill=]. Does anyone know why? \documentclass{article} %\usepackage[...
8
votes
0answers
3k views

How to incorporate and scale matplotlib plots in latex using the PGF backend?

I am using the pgf backend of matplotlib to generate pgf files which I want to put into my latex document using tikzscale to be able to resize them easily. Example python code: #!/usr/bin/env python ...
7
votes
0answers
68 views

No vertical spacing between TikZ Pictures

I would like to have absolutely no vertical space between the two TikZ Pictures. I could use for example \\[-1pt] but I don't know if 1pt is really the exact value... (so I removed it from the code)! ...
7
votes
0answers
128 views

Gravitational/electric field with tikzpicture

I used the package pst-electricfield, in conjunction with pspicture, to obtain a graphical representation of gravitational/electric field (see below). Is it possible to achieve the same results with ...
7
votes
0answers
281 views

HowTo: Tikz 3d Plot of an object

Hi I have problem with plotting an integration area. In the x-y-plane the area ist bounded by the polynoms 3x^2-1 and 3-x^2. In z-direction there are the limits z=0 and z=4-x-y. Now I want to plot the ...
7
votes
0answers
278 views

Special effects in TikZ leads to unprintable PDF

So I recently made a picture of the Mexican Hat Potential (related to the Brout-Englert-Higgs Mechanism of particle physics). I am more than satisfied with the graph and everything, but I noticed ...
7
votes
0answers
172 views

How to typeset a letter or grapheme specimen with alternates?

I want to print a font specimen for certain letters, each of which should cover a complete A4 page. The Open Type font contains many letters with several glyphs, which are accessible as character ...
7
votes
0answers
274 views

Absolute path for pgf externalisation

The graphic externalisation works well when it is done in a subfolder of my TeX files with the command \tikzsetexternalprefix{figures/} However, I get an error message when I try to set a different ...
6
votes
0answers
53 views

OS-dependent, bad rendering when embedding transparent images

I'm having a pretty strange problem with embedding a PDF image with some transparency in my Ph.D. thesis. I'm using the memoir document class, and compiling with pdflatex, although I have confirmed ...
6
votes
0answers
64 views

Xelatex, and strange textcolor behavior in tikz

Here is a minimal working example: \documentclass{beamer} \usepackage{tikz} \setbeamercolor{background canvas}{bg=black} \setbeamercolor{normal text}{fg=white} \begin{document} \begin{frame} \...
6
votes
0answers
57 views

Why does the pic option get passed through to the entire object?

Description This question follows from the question Why is the decoration marker off center? where we found what was causing the problem, but not why it was being caused in the first place. It seems ...
6
votes
0answers
75 views

Barchart with Different Colors and Labels for Positive or Negative

I have a simple bar chart below and I'd like to change the color of the bars if the value associated with it is positive or negative. I'd also like to change the Y labels to use different labels ...
6
votes
0answers
900 views

Error using tikz externalize: can't write md5 file

I tried to use the externalize library. It worked fine when all my files where located in the same folder. Usually I am using a subfolder as build folder, where all generated files should be stored. ...
6
votes
0answers
795 views

What is a good BPMN tool in Tikz

I'm looking for a nice package (or tool) to write BPMN diagrams directly into my documents. However, I had no luck so far. I found several tools that may help doing the diagrams, and then exporting ...
6
votes
0answers
686 views

Combining beamer, tikz, externalize and standalone

I've read a bunch of questions and answers on these topics as well as the documentation of the external library for tikz. I suspect I fundamentally misunderstand what I'm doing. I have a mindmap ...
6
votes
0answers
2k views

Tikzscale, trim axis left/right, and externalizing

tikzscale and trim axis do not play well together, with the produced figure being larger than requested because it ignores the size of the labels. I was wondering whether it is possible to use both ...
6
votes
0answers
178 views

Is is possible to associate part of a drawing to a pdfcomment (or similar) interactive bubble?

It is apparently possible to put a TikZ drawing inside a pdfcomment (but using mbox). Is is possible to associate only part of a drawing (e.g. a line) to a pdfcomment? Below it is the suggested code....
5
votes
0answers
39 views

Skip some x tick labels when using `xtick=data`

I am plotting some csv data with \documentclass[border=10pt]{standalone} \usepackage{tikz} \usepackage{pgfplotstable} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \begin{document} \begin{...
5
votes
0answers
67 views

How to apply colour options to the contents of TikZ nodes when the content includes \sbox{}\usebox{}?

Thanks to Sašo Živanović for helping to identify the problem which arises as a result of my trying to apply options such as blue or text=blue to nodes within Forest trees which include turnstiles from ...
5
votes
0answers
252 views

Drawing a plane inside a sphere in TikZ

I have the following code, which is basically a modified version of the sphere example from TeXample.net. \documentclass[crop,tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{calc,fadings} \...
5
votes
0answers
100 views

Tikz External vs. Overlay

While designing a title page in tikz I noticed a somewhat unwanted behaviour. When I use the externalize and the overlay option for a tikzpicture the output is just empty. MWE: \documentclass{book} \...
5
votes
0answers
46 views

Use of smooth in combination with text decoration in pgfplots gives error “Dimension too large”

The use of the option smooth in combination with the text decoration option gives the error "Dimension too large" Is this bug already known? What can I do? Short example code is given below. \...
5
votes
0answers
127 views

PGF Contour Plot with complicated (nested) functions

I have succeeded in making a simple contour plot by using the function \newcommand\expr[2]{ (-#2^4+#2^2)*e^-(#2^2+#1^2) + (cos((-#1/1.85*pi-0.45) r)/2.0-#1/3.0)/1.5 } MWE: \documentclass{report} \...
5
votes
0answers
81 views

svg package interfers with opacity

As soon as I load the package svg, tikz does not handle opacity any longer. Here, an example: \documentclass{article} \usepackage{tikz} \usepackage{svg} \begin{document} \begin{tikzpicture} \draw[...
5
votes
0answers
392 views

Transform paper folding diagram to 3D object or vice versa

I made this commands to make paper models, and I ask if it is possible to have a 3D view of them converting in tikz-3D, or backward. But it's easier to draw the flat model and generate the volume ...
5
votes
0answers
353 views

tikz: draw a piece of a path between given coordinates

I have a path in my application that I want to split up in smaller paths. These, I would like to draw with a label attached to them. Take the following image as an example: The upper arc is split ...
5
votes
0answers
159 views

Bad segment length evaluation in Tikz l-system

I would like to draw a fractal tree with Tikz lindenmayersystems library. Here is the code I use: \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{lindenmayersystems} \begin{...
5
votes
0answers
454 views

Chains in nested tikz pictures

I am trying to draw a complex item (consisting of multiple \nodes) as a cohesive whole using a nested \tikzpicture. My outermost picture uses a chain, onto which every \node is put. My inner picture ...
4
votes
0answers
49 views

Dimension too large Error in bar drawing

Here is my code. The following code returned ‘Dimension too large’ error. This error has different reasons since I cannot fix it after I surfed on the internet. The code would be work if I ‘change ...
4
votes
0answers
47 views

Include semicolon in preamble definition for tikz macro?

Say I define a macro \arr in the preamble for use in a tikzpicture. Is it best practice to: Exclude the semicolon from the definition and include it in the tikzpicture, \documentclass{article} \...
4
votes
0answers
35 views

Lines do not reach the border of node

I want to make a tikz-picture of a Hasse diagram and by problem is that the lines between nodes stop a bit short of the border of the node and I can't figure out how to fix this. Here is my code: \...
4
votes
0answers
90 views

drawing cobordisms using tqft

I would like to draw pictures of cobordisms like this one (image source): but perhaps more complicated. For this, I used tqft. However the incoming and outgoing boundary components should be ...
4
votes
0answers
58 views

Nesting tikzpictures, style inheritance and save box

Throughout my document, I need a custom symbol, which I draw using TikZ. I have created a macro for it, so I do not need to copy the picture. I also need to use the symbol within other tikzpictures. ...
4
votes
0answers
69 views

What is the preferred mechanism for reuse/encapsulation in TikZ?

I'm just starting out in TikZ, and I'm noticing a lot of friction around the issues of encapsulation and reuse, so I figure I must be missing some best practices. I want to create a multi-panel figure ...
4
votes
0answers
68 views

\title after \begin{document}: When to do it?

My answer to Problem using \alert{} in Beamer title with metropolis theme solves an incompatibility problem between TiKZ and \title with \protect-ed contents in beamer documents. Following code ...
4
votes
0answers
52 views

Tikz/pgfplot: draw option to plot a plot file at given position

I would like to use the draw function of the tikz package to plot a 2D experimental data at a given z altitude. Since I am using some kind of projection view, I would like to fix the z position of ...
4
votes
0answers
71 views

Tikz shading Issues

In the code below if I use the following code soft clip={domain=-3:3}, I get the graph on the top. If I use soft clip={domain=-2.99:3}, I get the graph on the bottom. Why does -3 not work? \...
4
votes
0answers
54 views

pgfplots: math expressions of variables in axis style

I would like to use a calculated value of pgf variable exp(\pgfplots@data@xmin) This is a concrete example what I need \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \...
4
votes
0answers
99 views

Normalized histogram (density) in pgfplots

I have a data file containing 100 256 values ranging from 0.01 to 3, approximately. I would like to plot the density of this data set. I have the theoretical (asyptotic distribution) drawn for ...
4
votes
0answers
160 views

drawing logo with tikz

I tried to draw this logo with tikz What's the easiest way to draw it ? Any advise ? My MWE: \documentclass[12 pt,a4paper]{article} \usepackage{xcolor} \definecolor{vertforet}{RGB}{...