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)

24
votes
2answers
5k views

How can I make a standard timeline?

I am looking to make a standard timeline, nothing fancy, like the one below (although, it does not have to be like that) using any library. How can I go about the achieving this in the best way?
3
votes
0answers
198 views

pgfplots — Patterns are not displaying correctly in PDF version 1.4 [closed]

I am using this method to plot a pattern in-between two curves. If I save the file as PDF version 1.5 everything looks great. Unfortunately the journal that I am submitting the paper to requires PDF ...
4
votes
1answer
1k views

drawing a circle in the xy plane when using 3d coordinates

I am trying to make a circle in the xy plane that has walls that slope up. How can I do this? Basically a bucket with a bigger opening then base. \documentclass{article} \usepackage{tikz, ...
1
vote
1answer
73 views

What syntax and parameter placement allows me to specify the radius of this circle inside tikz-pgf?

\begin{tikzpicture}[overlay,remember picture] \path node [draw, circle, inner sep = 0] at (current page.center) {Test circle\ldots}; \end{tikzpicture} I have this circle and want to specify it's ...
8
votes
1answer
1k views

Square edges in forest package

I can easily do trees with horizontal (square) edges in tikz-qtree (see MWE). The forest package is however a far superior alternative for my purposes. However, every attempt to do either horizontal ...
6
votes
3answers
329 views

\newcommand and boolean statements

I'm getting better at creating \newcommand instances but I've just reached a part where my knowledge is just not enough for it and also reading this site or the manual doesn't help. Basically I'd ...
14
votes
5answers
1k views

How to draw this pyramid with TeX?

I draw this pyramid with GeoSpacw. How to draw this figure with TeX? Where: $M$ is midpoint of the segment $SA$; $I$ is midpoint of the segment $SD$; $H$ is project of the point $A$ on the line ...
4
votes
1answer
195 views

Good-looking luminosity function plot

I'm trying to make a good-looking photopic luminosity function plot. So I want to make colored plot, but its colormap should depend on X values. Is it possible with pgfplots? I'll also appreciate any ...
4
votes
1answer
123 views

Exposing a new command for each element of a list

I have a macro lVars, defined using foreach from the pgffor package (part of PGF) as: \newcommand{\lVars}[1]{\foreach \x [count=\ii] in {#1}{ \ifnum\ii=1{} \else {,} \fi \lVar[\x]} } The intended ...
7
votes
1answer
282 views

Using TikZ to depict pitchlevel

After the very productive outcome of my recent question on intonation, I'm emboldened to ask a related question. In the previous one, particular pitchlevels are connected to produce an intonation ...
3
votes
0answers
75 views

Placing a node on top of lines in TikZ [duplicate]

I'm using TikZ to draw a polytope/simplicial complex and I'd like to label the vertices with their names (which are numbers). However, in the picture below, the node seems to be placed behind the ...
5
votes
1answer
568 views

How exactly do “in=angle” and “out=angle” translate to the path in TIKZ

I would like to know what exactly do the parameters in and out map to the path used. Specifically, say I draw a path with \begin{tikzpicture} \draw (0,0) to [in=30, out=40] (5,0); \end{tikzpicture} ...
21
votes
5answers
1k views

How to draw a diagonally-split grid with TikZ?

To draw the diagram I have written the following code: \documentclass[11pt]{article} \usepackage{amsmath,tikz} \begin{document} \begin{tikzpicture} \draw (0,0)--(0,8)--(10,8)--(10,0)--(0,0); ...
2
votes
1answer
281 views

How can I get the grid done correctly?

I'm trying to put the grid in my graphic, and I'm getting this problem below. The grid style must be help lines, and dashed, this I know how to do, but the problem remains in put the grid correctly. ...
1
vote
1answer
122 views

elliptical path estimation

I am going to use tikz to make the following picture (see below). I don't need advice or help in making the picture just estimating the ellipse since I don't have anything to reference. The ellipse ...
1
vote
1answer
126 views

Why does transform canvas change where the caption is?

I have a fairly large tikz diagram here: \documentclass[12pt]{amsart} \usepackage[all,cmtip]{xy} \usepackage{rotating, tikz} \usetikzlibrary{matrix,arrows} \title{None}% \begin{document} ...
8
votes
2answers
936 views

Combining `tikzpicture` and `lstlisting`

I'm working on a custom lstlisting environment, in which I use TikZ to add a frame and a title. Because of the widespread curly braces of node I cannot use newenvironment, so I have to resort to ...
8
votes
3answers
8k views

TikZ: different x, y scales but so that shapes maintain their aspects

I have some old pstricks code which I'm re-doing with TikZ. In my current picture, the x and y scales are different: \begin{tikzpicture}[xscale=1.8,yscale=4] However, this has the problem that ...
12
votes
1answer
842 views

Shifted hexagons in TikZ picture

Recently there was a great answer in How to draw a 3D hexagonal structure with TikZ? But I noticed a small "bug" which I can't seem to be able to fix. I stripped the code down that shows the problem: ...
2
votes
1answer
672 views

Need help in drawing the following Stacked Bar Graph

I want your help in drawing the following figure. I think it is called as stacked bar graph.
6
votes
1answer
115 views

How to take off the marks of a graphic made with a CSV file

I'm importing a CSV file and I want to take off the marks of the graphic,how can I do this? \documentclass{minimal} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} %\usepackage{filecontents}% ...
4
votes
1answer
488 views

Use \usetikzlibrary{quotes} with \MakeOuterQuote{"} from csquots

Is there a way to use (disable) \MakeOuterQuote{"} in tikz while using \usetikzlibrary{quotes}? MWE: \documentclass{article} \usepackage{csquotes} %\MakeOuterQuote{"} %breaks tikz library ...
7
votes
1answer
437 views

Diagonal text in diagonal matrix

I have a tridiagonal matrix whose diagonals d_{-1}, d_0, d_1 (thought as vectors) can be written as vector expressions. Is there a way to nicely represent this, e.g. via a matrix which is blank ...
6
votes
1answer
2k views

Draw 3D rectangle

I've been searching this for hours, but didn't find a reason for this behaviour: Here is my example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{3d} \begin{document} ...
3
votes
1answer
807 views

TikZ reuse code for building nesting pictures

This is not new here. But with the solutions in: Problem with overlay when a tikzpicture is inside another tikzpicture How to typeset a TikZ picture inside a node? I couldn't put it to work. ...
2
votes
1answer
318 views

TOC longer than 1 page messes with Tikz absolute positioning on following pages

I have an issue where a TOC on more than one page, ruins the tikz-positioning for the rest of the pdf. Example: The header has been moved to the bottom of the page where it usually stays on the ...
1
vote
2answers
916 views

Is there any tool to draw bezier curve and transfer the coordinates to tikz?

Is there any tool to draw bezier curve graphically. Using the coordinates in the tool, can we draw bezier curve in tikz?
10
votes
2answers
706 views

Typesetting a directed hypergraph in tikz

Similar to several other questions, I am trying to draw hypergraphs in tikz. I want to draw a directed hypergraph that looks something like those in this image from here: As opposed to other ...
5
votes
1answer
1k views

Adding two labels to an edge in TikZ, close to the endpoints

I'm quite new to TikZ. I know how to make two nodes A and B, how to connect A and B by an edge with the draw command, and how to add a label to the edge. But now I want to add two labels: One close to ...
31
votes
5answers
1k views

Using TikZ to depict intonation

I am looking into using TikZ to represent pitch patterns over a phrase or sentence (intonation). I've got it to produce some useful results, already, as in the attached MWE (although in 1.1 the ...
6
votes
3answers
524 views

How to use data structures in TikZ?

I created a foreach statement, using expl3 and TikZ/pgf: \documentclass{article} \usepackage{tikz} \setlength{\parindent}{0cm} \usepackage{expl3} \ExplSyntaxOn \cs_new:Npn \Counter #1 \Stopper { ...
4
votes
1answer
1k views

How can I draw a TikZ picture in the top left corner of an A4 page disregarding printing limitations?

I'm after a way to draw an oval that is in the centre of my page and touches all sides of the A4 page. I need it to happen many times as I'm drawing a complicated graphic. So far I have been hindered ...
8
votes
3answers
883 views

How do I make tangents to ellipses and lines parallel to these?

I have specified an ellipse and three points in the following way: \def\aa{2.5} \def\bb{2} \draw[thick] (0,0) ellipse [x radius=\aa,y radius=\bb]; \pgfmathsetmacro{\focus}{sqrt(\aa*\aa-\bb*\bb)} ...
3
votes
1answer
245 views

Tikz Scaling and Positioning

I cannot scale the first picture. scale=0.6 does not work. Also I cannot vertically align the picture. I want top of text and top of figure are same. See figures in the following examples. ...
0
votes
1answer
8k views

How do I install TikZ into my MiKTeX

How do I install the TikZ package to my current MiKTeX?
4
votes
1answer
509 views

Figure width problem

I have a problem in a figure which i draw, the figure doesn't fit in one column of two column paper as shown in the fig below, any help? \begin{figure}{H} \centering \begin{tikzpicture}[ ...
4
votes
2answers
2k views

[Tikz-]Qtree: force direction of single child to left or right?

I'm trying to draw a tree that has internal nodes with only one child, but which must be oriented. / \ /\ \ /\ Instead of the typical qtree where said children just "hang": ...
5
votes
1answer
408 views

Node only partially rendered near edge of plot

I'm trying to draw a relatively simple chart of a number line, and when one of the nodes is too close to the edge of the plot, it gets cut off. The code: \documentclass{article} \usepackage{natbib} ...
3
votes
0answers
218 views

Adding external figure using TikZ [closed]

I want to include figure in my pdf using TikZ. I used the following code but the figure disappears: \documentclass[12pt,vi,twoside]{mitthesis} \usepackage{lgrind} \usepackage{hyperref} ...
5
votes
1answer
887 views

Plotting a 2D gaussian sample

Can you please help me with making a 2D Guassian sample with specified means and variances? I only know how to make a guassian curve :D \documentclass{article} \usepackage{paralist,pst-func, ...
2
votes
1answer
583 views

PGFPlots slow down compilation when plotting from external files

I am writing a report containing multiple plots of spectroscopic data by way of PGFplots which is fetching data from external files. It used to do the work, and after a few minutes of compilation it ...
3
votes
1answer
353 views

Calculating the minimum height for a node based on the size of other nodes

Consider the following example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{xcolor} \begin{document} \def\mydist{1mm} \begin{tikzpicture}[ mystyle/.style={ ...
9
votes
1answer
2k views

Why does pgfplots plot functions only until x = 5 and y = 5?

Why does pgfplots plot functions only until x = 5 and y = 5, but not any further? \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} %%%< \usepackage[active,tightpage]{preview} ...
4
votes
2answers
941 views

Tikz for Commutative Diagrams

I need to use tikz package because of the quality of commutative diagrams it produces as I've seen in some manuals. I've tried it severally but all to no avail. I'm using MiKTeX with TeXmaker editor ...
1
vote
0answers
183 views

Alignment of TikZ object [closed]

I'm using the classic thesis style by André Miede. As I have to import a lot of Matlab plots, I'm using matlab2tikz. In the LaTeX document, I want the TikZ object to act like a normal jpg/png ...
4
votes
2answers
413 views

Aligning tikz picture within text

I want to align my tikz within a text. A sample can be seen at the second picture in the following link: Image courtesy from http://www.echoecho.com/htmlimages08.htm This is my trial: ...
2
votes
1answer
1k views

Multiple labels with “node label”

I make some experiments with \pgfkeys after the Qrrbrbirlbel's answer to this question The first try is : \documentclass{scrartcl} \usepackage{tikz} \begin{document} ...
1
vote
0answers
53 views

How to set node label position with anchor [duplicate]

Actually, I write some notes about programming with Tikz and reading Jake's answer to this question, I asked myself how tikz places the "node label". I would like to reproduce: ...
5
votes
1answer
336 views

Plot the \coordindex in alphabetic order

I need to replace the index numbers in the plot by alphabetic sequence. For example, on the following graph instead of 0,1,2,..., I want to see a,b,c,... \documentclass{standalone} % This file is an ...
14
votes
3answers
1k views

Repeated division - Converting from base 10 to another base

I am teaching how to convert from one base to another base, however, I can't find a way to do something like this: I know little about Tikz, the only thing I have been able to produce is a simple ...