{coordinates} is about using coordinates in diagrams.

learn more… | top users | synonyms

21
votes
4answers
8k views

TikZ: difference between \node and \coordinate?

What is the difference between \node and \coordinate in TikZ? Exchanging them does no visual effect in my (to be honest: still simple) pictures. When to use what?
18
votes
2answers
5k views

Problems with TikZ calculations

When can I use functions and do calculations in TikZ? How do I make this work: \draw (0,0) arc(0:90:sqrt(15)); %not ok why is this working: \draw (0,0) arc(0:asin(1):5); %ok with ...
18
votes
2answers
1k views

Accessing the logic values of a TikZ coordinate

In TikZ accessing the coordinate values of a node can be done using the let syntax of the calc library or using the PGF command \pgfpointanchor. However, this values are dimensions/lengths in points ...
16
votes
3answers
3k views

How to draw a coordinate system with LaTeX?

I want to draw a coordinate system like this: I would like to specify the width and height of the coordinate system and where the origin begins (upper left corner). I also want to specify the x and ...
16
votes
2answers
382 views

Can LaTeX place text by mm coordinates?

My system generates LaTex letters and templates; however, my client has to fill out pre-built forms that they have no control over. I'd like to fill out these forms by measuring the coordinates in mm ...
15
votes
2answers
3k views

How can I compute the distance between two coordinates in TikZ?

Given two points (defined, for instance using nodes), I want to compute the distance between them. Is there some build in functionality in tikz to do this? If not, how can it be done using the ...
14
votes
4answers
458 views

How to create a macro with two or three ;-separated arguments?

I want to create in 2D a point with \defpoint(1;2){A} and in 3D with \defpoint(1;2;-5){A}. I prefer a solution with TeX but it would be interesting to see if LaTeX3 is useful in this situation. I ...
14
votes
3answers
4k views

Transforming coordinates, so (0,0) from tikzpicture is put in the desired place of the page

In tikz I can perform absolute positioning, e.g. (current page.center), but how I can specify/transform the coordinates, so (0,0) within tikzpicture will end in well-defined place like center of the ...
14
votes
2answers
620 views

Computed coordinates are all the same?

It's embarrassing question time. Why are my computed coordinates all showing up at the same location? The larger filled quarter circles are drawn with: current page.\x where \x is south west, ...
14
votes
2answers
3k views

Using TikZ coordinates in expressions?

I would like to be able to calculate two new \coordinates by starting from two existing coordinates. I have defined two coordinates c1 and c2. A minimal example would be \documentclass{report} ...
12
votes
2answers
651 views

Draw in cylindrical and spherical coordinates

I can try to draw this in TikZ: I managed to draw the coordinate axis. The first image is in cylindrical coordinates and the second in spherical coordinates. I don't know draw in spherical ...
12
votes
2answers
443 views

Is there a better way to do intersections and calculations with relative coordinates in TikZ?

I've been doing many TikZ diagrams lately and every so often I encounter a situation where I am forced to use some temporary coordinate in a \path. In the following short example, the problem is ...
12
votes
1answer
2k views

How can I express half the distance between two nodes?

I want to draw a line from node A half-way to node B in TiKZ. How can I find express the end point?
12
votes
2answers
367 views

How can I do an affine coordinate transformation in pgfplots?

It is possible to perform a general affine coordinate transformation in TikZ by combining the shift, x, and y keys (or just the generalized cm key to set the coordinate matrix and shift). This allows ...
11
votes
5answers
234 views

automatic tikz coordinate calculations

Right now I have these defined: \coordinate (Z1) at (0.9,0.5); \coordinate (Z2) at (0.816,-0.112); \coordinate (Z3) at (0.46848,-0.46336); But I would really like to automate this to be: so that ...
11
votes
4answers
288 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} ...
11
votes
2answers
285 views

Relative coordinates in PSTricks

TikZ gives us the ease of using relative coordinates, like in the following example. \documentclass[border=3mm]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} ...
11
votes
1answer
3k views

How to specify a Tikz coordinate relative to a node?

is there a simple idiom (one not using the calc library) to specify a Tikz coordinate relative to a node? Something like \coordinate (x) [right=of A]; instead of \node (x) [draw=none, right=of ...
10
votes
5answers
1k views

Transform defined coordinates in TikZ

Say I have a triangle with vertices defined using \coordinate (a) at (0,0); \coordinate (b) at (1,0); \coordinate (c) at (0,1); Let us denote by T(x,y) the triangle defined by (a),(b) and (c) which ...
10
votes
1answer
2k views

pgfplots - Placing Nodes on x Coordinates of a Plot

I want to plot some graphs in pgfplots and want to place nodes on the exact same x coordinate of the plot. The position of the note has to be set in x direction but free in y direction. Here is one ...
9
votes
1answer
469 views

Curve synthesis - Adding two curves to get another one

Case 1: Let's say I have a few coordinates (A), (B), (C), (W), (X), (Y), and (Z) (possibily obtained through intersection, rotation, and whatnots). I draw two piecewise linear curves through (A), ...
9
votes
1answer
467 views

normal coordinate system in tikz using parallel curves

I have a wavey looking curve and would like to show the corresponding normal coordinate system, which is defined by arclength along the curve and (signed) distance from the curve. So there should be ...
8
votes
1answer
967 views

tikz: placing nodes relative to the bounding box coordinates

I have a tikzpicture,in this case a blue rectangle, that will produce a bounding box, here visualized by the green background. I would now like to place a node in the top left corner of the bounding ...
7
votes
3answers
1k views

extract x value from coordinate in TikZ

maybe I'm stupid, I looked at the many examples in which somehow shows the work with the coordinates, but I don't understand it. Simple example - I have: \begin{tikzpicture} \coordinate ...
7
votes
3answers
346 views

Global Coordinates

How can I declare coordinates in a block and access them from outside of the block? \begin{tikzpicture} \foreach \x / \y in { 1 / 3, 2 / 8, 3 / 14, }{ \coordinate (N\x) at ...
7
votes
2answers
156 views

Coordinate system along line

I would like to draw a coordinate system along some lines in a framework for a structural course. This little coordinate system is called local coordinate system. At the moment the framework looks ...
7
votes
2answers
170 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} ...
7
votes
3answers
269 views

drawing points coordinates in a graph

I need to draw points coordinates in a graph. In my case, the problem is that the values of the x-axis and y-axis of each point can be very large. That is why I need to edit the code below in order to ...
7
votes
2answers
456 views

Transforming “rel axis cs” to absolute coordinates?

I've got two plots arranged vertically using \matrix. I'd like to draw a vertical line, that spans over both plots with a margin of 1cm at the top and at the bottom. The starting point of the line ...
7
votes
2answers
159 views

How to get a reasonable coordinate system when combining pdfpages and TikZ?

I have been trying to add content to a (proprietary) PDF with LaTeX by using pdfpages to inlude the original pages and draw on them using TikZ. This is the code I have been using: ...
7
votes
1answer
97 views

Placing node at path using `midway` in pgfplots

I thought my problem would have been possibly answered anywhere here, but I could not get it to work. Questions I consider linked to mine but which weren´t able to solve my issue are node placement ...
7
votes
1answer
158 views

Create a coordinate node at each point of a path

How can I create a TikZ/pgf-style that will put a coordinate, which should be named automatically, at each point of a path? So the following code \draw[put coordinates](0,0)--(3,2)--(4,7)--(-2,1); ...
6
votes
1answer
388 views

Tikz - How to determine the coordinates in fill

How to create Candle Symbol in LaTeX I previously asked a question about making candle light and got amazing answers. To todd's answer I have another question which would help understand basics of ...
6
votes
1answer
381 views

TikZ change coordinate system so Y points downwards

How can I change the default coordinate system of TikZ, so the Y coordinates go downwards, instead of upwards. This is because in the picture I'm trying to draw it is more natural to reference points ...
6
votes
2answers
1k views

Coordinates A, B: compute |B-A| and angle between +x and (B-A)

This question has two parts: why is the angle computed always 0 (should be 45) what is a straightforward way to compute distance between coordinates (there is How can I compute the distance between ...
6
votes
1answer
369 views

Extracting x, y coordinates of an arbitrary point in TiKZ while using yscale and xscale

Inspired by Extract x, y coordinate of an arbitrary point in TikZ, I am trying to use the x coordinate of a point to draw another element. However, when I use the yscale and xscale commands, the ...
6
votes
1answer
2k views

How to position one node relative to another node at a certain angle in TikZ taking the nodes' size into account?

I asked a question before about how to position a node relative to another node at a certain angle in TikZ, and the answer I got there was that you can use the \path (node1) ++(angle:distance) node ...
6
votes
1answer
529 views

Generalised: Accessing the logic values of a TikZ coordinate

In another question concerning Access to logic coordinates on Accessing the logic values of a TikZ coordinate I used these functions, until I came to a scaled tikzpicture and then it was off. I now ...
6
votes
1answer
396 views

Problem with external graphics and 3D pgfplots

I want to include an external graphics with pgfplots. I tried to follow the instructions of the manual (p45 et seq.) as carefully as possible. But the result is hoorible as hell. Here is the code I ...
6
votes
1answer
114 views

How to prepare coordinates for 3D surface plot using pgfplots

I'm trying to plot a Pareto front on 3 dimensions, using pgfplots. However, although I expect a nice surface to appear (since it is a Pareto front), pgfplots does not produce the result I want (yet). ...
6
votes
1answer
511 views

perspective tikz figure 3d

I want to rotate my figure, like here below: \documentclass{standalone} \usepackage{tikz} \usepackage{tikz-3dplot} \begin{document} \tdplotsetmaincoords{180}{0} ...
5
votes
1answer
75 views

Specify x and y in different coordinate systems in pgfplots similar to gnuplot

In gnuplot you can specify positions in several coordinate systems: First, Second, Graph, Screen, Character. What are the equivalents in pgfplots? I know the following: First : axis cs: Second : ...
5
votes
1answer
289 views

How to create symbolic x coords without losing last bar

I've created a bar chart with labels for the x coordinates. But if I don't put a xmin/xmax in, only half of the first and last bar appear. If I add a xmax it shows up on the axis. ...
5
votes
1answer
2k views

How to make a textbox with this TikZ code ?

I made this with TikZ : \usetikzlibrary{calc} \def\banlen{3} \xdefinecolor{mycolor}{RGB}{62,96,111} % Neutral Blue \def\bancolor{mycolor} \begin{tikzpicture} \draw (0.25,0.25) rectangle (5,-2); % ...
5
votes
1answer
307 views

tikz coordinate calculations gone wild

I'm quite a bit baffled why my coordinate calculations are coming out so differently. All coordinates are where I expect them to be, except coordinate Z. \documentclass{article} \usepackage{tikz} ...
5
votes
2answers
154 views

Labeling node values on the axes

I want to draw some curves and some special coordinates on the curves, then label the nodes on the axes. So far I have done it manually like this (it's a diagram for the Markowitz risk premium in case ...
5
votes
1answer
95 views

Remember coordinate in nested tikzpicture points to a weird place

I have problems with remembering the coordinates of names defined in nested tikz pictures. Look at the following minimal working example: \documentclass{article} \usepackage{tikz-qtree} ...
5
votes
1answer
2k views

Circuitikz - IC circuit with relative coordinates

I've represented an IC circuit using circuitikz, but it's a bit too rough to what I prefer. In particular I would like to use relative coordinates in this case and connect them to the ``IC device'' so ...
4
votes
2answers
298 views

Tikz coordinates relative to a node, and outside it

Given a rectangular node X I have access to the coordinates (X.north), (X.east) and the like. However, I want to be able to draw two sides of a right-angled triangle on top of the node. For example, ...
4
votes
1answer
204 views

Wrong point when barycentric coordinates in triangle add up to one

I am trying to plot points on a triangle using areal coordinates (barycentric coordinates that add up to one). Using TikZ and the barycentric coordinate system, however, this gives the wrong point in ...