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)

1
vote
1answer
475 views

tikz - placing two nodes side by side

my preamble: \documentclass{beamer} \usepackage[english]{babel} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{tikz} \usetikzlibrary{positioning} Using ...
4
votes
1answer
233 views

number format in \pgfmathsetmacro for auto-foldernaming in tikz \foreach environment

What I want to do is creating automatically the filenames of the datafiles inside a foreachloop in tikz. Maybe it's better to show a minimal example first: \documentclass{standalone} ...
6
votes
1answer
404 views

Setting the color of a draw command inside foreach

I am trying to draw colored lines with a foreach loop. The command I use to draw the line creates a colored line if I use it standalone. Once I put it inside the foreach loop, I only get a black line. ...
7
votes
1answer
536 views

Common label for a groupplot [duplicate]

This can be considered a combination of the following questions How can a title be placed for a group of pgfplots? Align ylabels of grouped plots at a common line The following piece of code ...
1
vote
1answer
467 views

A question on tikz/pgf externalization, standalone, and includeonly for compiling large document

I have a goal to build an efficient compiling environment to build large documents. The requirements are these: Use tikz/pgf to draw many figures; Use \includeonly to build only a portion of the ...
10
votes
1answer
752 views

Recreate plot when data file changes

Is it possible to use the TikZ/external library and have pgfplots recreate a figure when a data file that is plotted changes? Say I have something like the following: file.tex: ...
5
votes
2answers
452 views

How can I label TikZ-graphs on four vertices with a loop?

I need to draw all these simple labelled graphs on four vertices. Anyway, can I do this in a quick manner with a loop? And put them in an array? I have already drawn all unlabelled simple graphs on ...
2
votes
0answers
178 views

Legend in graph with tikz [closed]

I need to make a legend for my graph in TikZ, but I need that legend would be from 3 columns, how can I do this? I use this code: \newenvironment{customlegend}[1][]{% \begingroup \csname ...
6
votes
1answer
219 views

How to plot sectors in 3D with LaTeX?

I wish to have two sectors (one in blue color, the other in black pencil) in 3D, and they share the same vertex on the plane. The black pencil one lies on the plane, whereas the blue one is theta ...
5
votes
3answers
810 views

How to connect two lines in TikZ?

I finally managed to draw the following path diagram with TikZ. Now, however, I am facing a challeging task. I would like to connect two edges/lines (here drawn in red; for the social scientists, I ...
3
votes
0answers
553 views

Clustered Stacked bar Chart Overlapping Labels

I have following code by which I generate the following graph \documentclass{article} \usepackage{pgfplots} \usepackage{tikz} \usepackage{xcolor} \usetikzlibrary{arrows,automata,calc,shapes, ...
5
votes
1answer
1k views

How to set Tikz scatter marker weight?

I'm using tikz to produce scatter plots as shown in this question. I can define the marker size with \tikzset{mark size=8} but now I'm looking for a way to make the line of the marker thicker in a ...
4
votes
1answer
231 views

Tikz + Verbatim + Sphinx , output drawn twice with slight offset. Works great Tikz + Verbatim

I'm working on a piece of software that outputs IPython Notebooks as tex documents. One of my requirements is to be able to draw code input output blocks that look like the Notebook's UI. ...
26
votes
2answers
1k views

Arguments for TikZ style

Motivation To put arrows inside of a TikZ path I have defined myself a TikZ style arrow inside. To make it even more portable I want it to take arguments like this \draw[arrow inside={pos = 0.1, end ...
8
votes
2answers
116 views

Use labels from file in Tikz

I want to compare data from two files in a 4 by 4 grid. The data files are like this: data1.dat: A B C D ..... data2.dat: 1 2 3 4 ......... I am able to set up the grid with the ...
11
votes
3answers
4k views

Table with TikZ

I should create a table like the one here as example. I think that the best way to do a table like this one is generate some labels and use them to colorize the nodes in order to make it more ...
3
votes
1answer
519 views

How to scale tikz drawing to paperwidth?

For use as a headline in beamer, I would like to scale the following tikz image to \paperwidth, preserving the x-y-ratio. I seem to be too dumb to find this (easy?!) solution... Thanks for any help! ...
14
votes
3answers
623 views

Drawing complex diagrams with TikZ using gradients

I am relatively new to LaTeX. I don't find it an issue writing documents and so on but when I try to draw diagrams I run into some bother. I was reading an article and found this diagram: I was ...
2
votes
1answer
254 views

TikZ externalise: overlaying figures

I’m using MikTex 2.9 x64 and would like to use the LaTeX -> dvips -> ps2pdf way to compile my document. Additionally I’ve a lot of Matlab2tikZ figures and would like to make use of the ...
7
votes
1answer
131 views

Why ' every label/.style={draw}' also `fill`s?

Please look at next code and its result: \documentclass[tikz,border=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[every ...
4
votes
1answer
270 views

How can we only plot grid in X direction?

How can we only plot grid in X direction? Could we change "grid=both" to "grid=..."? \begin{tikzpicture}[scale=0.8] \begin{axis}[ grid=both, domain=0:2*pi, samples=200, no marks, ...
4
votes
1answer
271 views

callout boxes not aligning with aligned environment content

I've been able to create the split rectangle successfully. I've been able to work with \tikzmark and callout boxes. But now that I'm combining the two, something is going seriously wrong. Here's my ...
5
votes
1answer
131 views

Why do I have two different styles for my bar plots?

I have two bar plots—one uses error bars and draws its data from a table, the other does not. As far as I can tell, this is the only difference between the two. Why are they displayed in different ...
4
votes
3answers
357 views

Adding Tikz node in pgfextra triggers double drawing of containing path

This is a follow up question to Adding nodes in a style If I use the following code, I obtain a strange behavior: Code \documentclass[tikz]{standalone} \usetikzlibrary{matrix,fit,backgrounds} ...
3
votes
3answers
1k views

TikZ exits with “do not know the key '/tikz/restrict y to domain”

When I try to compile, I get the following error. Runaway argument? samples=60, domain=0:10, xmax=10.5, restrict y to domain=0:10, axis l\ETC. ! Paragraph ended before \pgfplots@@environment@axis ...
3
votes
1answer
336 views

tick mark/range problem on graph generated using TikZ

I'm having a little difficulty getting a tick mark on a graph generated using TikZ to appear correctly. The code is below and the problem can be seen in the vertical axis of the second graph (b). How ...
2
votes
1answer
901 views

How do you break long lines in pgfgantt?

I am drawing a gantt chart using the pgfgantt package. I have some text in nodes that I would like to break down into multilines, but it doesn't seem to work. I made a simple example like so: ...
3
votes
1answer
720 views

A simple (indented) integration contour with Tikz

I would like to draw an integration contour which is pretty easy I think, but I am a newbie at the Tikz package. The integration contour goes from -i*infinity to +i*infinity parallel to the ...
2
votes
1answer
873 views

TikZ - graphs of elementary functions

I would like to ask you if you have something like graphs of elementary functions on one page made in TikZ. I write thesis and I would like to get inspired by your code and design. It would be very ...
12
votes
4answers
350 views

Can tikz coordinates be exported to a text-file?

Can tikz coordinates be exported to a text file, while the document is rendered? Let the document be: \documentclass{scrartcl} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} ...
3
votes
2answers
2k views

Tikz picture, align left in column using beamer

I'm currently struggling with aligning a tikzpicture, within a figure environment, at the left of a column. It seems like the figure is always align centre, or right Using beamer, for a presentation. ...
5
votes
1answer
577 views

Reduce white space above TikZ label

I'm new to TikZ, and have drawn the following picture, \documentclass[12pt,a4paper]{article} \usepackage{tikz} \usetikzlibrary{trees,arrows} \begin{document} \begin{tikzpicture}[every ...
1
vote
1answer
1k views

Change arrowhead in line style definition

I'm trying to define a size for the arrowhead of a style, like this: \begin{tikzpicture} [line/.style={draw, ->, >=stealth, arrowhead=1cm}] % define nodes ... % define links ...
4
votes
1answer
189 views

Changing parameters in a groupplot

The idea behind the following sample code is this: There should be four plots, and for each plot two parameters should be set. This is achieved through \def just before \nextgroupplot. Apparently, ...
6
votes
1answer
449 views

Including tikzlibrary in .sty file

This might be a silly question, but I know that there is \RequirePackage{} for writing a .sty file. Is there something like this for requiring the inclusion of a TikZ library in a .sty file? I ...
2
votes
2answers
979 views

TikZ & PGFPlots: adding a TikZ 3d axis into a pgfplot

\documentclass[tikz]{standalone} \usepackage{tikz-3dplot} \usepackage{pgfplots} \pgfplotsset{compat = 1.8} \begin{document} \tdplotsetmaincoords{60}{130} \begin{tikzpicture}[tdplot_main_coords] ...
2
votes
1answer
240 views

Adding nodes in a style

I have the following code, which draws a matrix and then uses the nodes inside the matrix to create new nodes: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{matrix} ...
8
votes
3answers
304 views

tikz: segments with 5pt dotted ends

I am using tikz and would like to draw some straight line segments such that both ends of the segment has 5pt dotted and the rest plain. In pure text, it would be something like ...
3
votes
1answer
664 views

Tikz: Scale coordinates perhaps using the calc package

I've drawn a rectangle like this: \draw[color=orange, fill=orange, opacity=0.1] (Q3term1) rectangle (Q3term2); and essentially, what I want is to do is stretch the rectangle by 10% horizontally and ...
4
votes
2answers
154 views

tikz draw tree with extra column

01, 001 and 0001 are not actually "childs". How do I add K=1,2,3 and K=4 to the left hand column? And I tried really hard to adjust the distance. But this is the best I can do. Thanks. ...
3
votes
0answers
65 views

How to draw a closed curve around a set of points/nodes keeping a minimum distance? [duplicate]

I basically want to achieve the same thing in Tikz as Ilonpilaaja in the following question: TikZ: Curve through specified points However, I have to do this multiple times with nodes that are ...
7
votes
2answers
272 views

How to extract coordinates in the current scope (before the coordinate transformation matrix is applied)

If I extract coordinates with \pgfgetlastxy{}{}, I get changing results depending on the transformations I've applied to my draw (rotation, scale): \documentclass[margin=0.5cm]{standalone} ...
8
votes
2answers
198 views

Included graphics with text: Alignment

tl;dr How do I align text to text within \included graphics? Let's look at the following logo, which I want to include (in a vector format, e.g. pdf or svg). The blue/red lines are my annotations. ...
5
votes
1answer
387 views

Drawing generic cumulative distributions

It might be trivially easy to learn but this is a bit urgent for me. So if anyone has some sample codes in latex to share with or document easily explain how to obtain something like ...
1
vote
0answers
312 views

pictograms, Iconography, scalable shapes, custom nodes, shapes [closed]

Hy, I'm building up my own iconography, a set of pictograms that represent ideas so that i can connect them to illustrate more complex systems. I would like some suggestions of which is the best ...
3
votes
0answers
62 views

Tikz: Arrow description closer to arrow [duplicate]

I want $Q(g)$ closer to the diagonal arrow in this tikz-picture. How can I manage that? Thanks. \begin{tikzpicture}[description/.style={fill=white,inner sep=2pt},baseline={([yshift=1.5em]current ...
6
votes
2answers
350 views

Straight math arrows

Is there any way to redefine all arrows in math mode (\rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \to, etc.) to another arrows that finish with angle 90 TikZ option? I have done some tries and ...
1
vote
0answers
253 views

Change path of where tikz externalization saves the pdf and eps

I am using the TikZ externalization to speed up the compilation process and to have the eps files for the admission of the article which I'm writing. So I have lines like \begin{figure} ...
5
votes
1answer
1k views

TikZ: using name intersections to define a node

Two questions: What is going wrong with these nodes that are defined from the intersections? Can this be automated with \foreach syntax to find the other vectors for the 2nd point? I couldn't ...
9
votes
1answer
760 views

Randomized coordinates in TikZ

I need to draw a number of `bacteria' in TikZ. Their coordinates and orientation needs to be random within a pre-defined scope. I have randomized the orientation successfully, but not the location of ...