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
2answers
1k views

Drawing a hyperbola of a certain eccentricity in TikZ

This question is a follow-up question to half of a hyperbola. When constructing a hyperbola in TikZ, how can I specify the eccentricity to be 1.44022?
8
votes
2answers
685 views

half of a hyperbola

Only top portion of half my hyperbola is coming in correctly. The other half is doing something strange: \documentclass{article} \usepackage{tikz, pgf} \begin{document} \begin{center} ...
2
votes
1answer
423 views

how to add new page (page break) to article

This is my code, I am learning how to use the TikZ package and am trying to put different examples on different pages. I would like to have a page break between lines 22 & 24 if at all possible. ...
21
votes
3answers
3k views

Projection of Circle onto Spherical Surface

I want to draw shapes looks like 15 degrees tilted-semi-sphere and there are circles, placed in a triangular shaped array, on the base area. Then these circles are projected onto surface of sphere. ...
4
votes
0answers
462 views

Is fine-grained grid control possible? [closed]

I want to make a variety of checklists which are essentially based on a grid layout. I care about having fine-grained control over the exact placement of labels and boxes. I do not care about ...
5
votes
1answer
387 views

Align TikZ grid with geometry crop marks

I am drawing a grid on top of the layout defined with geometry. \documentclass[letter]{article} \usepackage{geometry} \geometry{ showcrop, paper = a4paper, layout = a5paper, ...
1
vote
0answers
324 views

Plot a range/subset of coordinates in Tikz [closed]

SOLVED: How would you plot subset of a function in Tikz: In Syntax for smoothing a coordinate plot with the foreach command \documentclass{article} \usepackage{tikz} ...
8
votes
1answer
477 views

TIKZ drawing Gaussian Blur

I am a complete newbie to latex and have been working on thesis. At the moment, I am trying to draw this and have no idea how to start. I did some google and found out that tikz is very popular for ...
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
999 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
328 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
281 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
558 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
121 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
933 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
436 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
803 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
317 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
914 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
703 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
523 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
882 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
507 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
407 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
884 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
581 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
352 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={ ...