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
1answer
122 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
280 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
519 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
280 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
116 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
923 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
833 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
670 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
481 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
433 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
793 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
315 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
898 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
687 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
520 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
874 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
243 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
502 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
385 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
871 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
561 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
345 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
927 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
181 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
409 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
325 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 ...
7
votes
2answers
149 views

Why are the ticks of my axis displaced to the left?

I'm trying to make a timeline in a tikzpicture. However, the ticks of my timeline are displaced to the left. Can someone please help me fix this? \begin{tikzpicture}[x=2cm,y=2ex] %draw horizontal ...
10
votes
1answer
1k views

Create a footnote in node in a tikzpicture

I would like to add a footnote to a node in a TikZ picture, but every solution I could imagine fails. I tried using a minipage, too. \documentclass[a4paper,10pt]{scrartcl} \usepackage{tikz} ...
7
votes
1answer
8k views

How to remove the frame of a plot in tikz but keep the axes?

I want to have a plot in tikz, with the horizantal an vertical directed axes, without numbering and without frame. Right now my code is as follows: \documentclass{article} ...
5
votes
1answer
1k views

Bar charts: Change the vertical order of different plots and corresponding legend entries

I want to compare percentages of two different years using horizontal bar charts. The values for the 2 years (1996 and 2011) are given via a pgfplots table. I want the 1996 values to be shown in top ...
7
votes
3answers
551 views

What is the TikZ equivalent for the following PSTricks code? Drawing a free fall diagram

I want to learn TikZ using "learn by example" approach because this way helps me to save time by skipping unnecessary concepts. I have made an example, it is a free fall diagram in PSTricks as ...
2
votes
1answer
2k views

how to put two pictures together using minipage

I wish to put two pictures side by side using mini page, however, it seems the two pictures even not in the same borderline. Here is my code, I can not figure out what the problem is. ...
4
votes
1answer
475 views

CircuitTikZ splitting input into two gates

I have LaTeX code using the CircuitTikZ package for drawing a simple logic circuit, but I'm not convinced that my code is the correct way to do what I'm trying to do. Essentially, I have two inputs ...
4
votes
3answers
172 views

TikZ - bad positioning of images drawn by macro

Probably a lame question about how positioning in TikZ works. I'm trying to draw some electrical stuff (starting on the level of single gates) and because many of them repeat over and over, I want to ...