# Questions tagged [coordinates]

{coordinates} is about using coordinates in {diagrams}.

420 questions
Filter by
Sorted by
Tagged with
1 vote
56 views

### What is the difference between single and double plus in tikz coordinates? [duplicate]

I've been using double plus in TikZ for relative coordinates: \draw[-] (somecoord) -- ++(1,0); but I have found TikZ code with single +. What is the difference between ++(dx,dy) and +(dx,dy)?
• 2,850
159 views

### Easiest way to draw celestial sphere diagrams [duplicate]

I was hoping someone might be able to give some helpful advice. I've seen this question popping up a few times on the forum, but I just find all the answers too complicated and difficult to follow. I ...
38 views

### Is it possible to record the exact location of a box in latex after generating a pdf? [duplicate]

In my latex quiz code, I can generate boxes for users to write like this: \ans{3cm} The problem is, depending on the surrounding text, the exact location of the box will shift. Is there a way to ask ...
• 1,521
257 views

### Dividing by sums in TikZ coords

I want to input mathematically calculated coordinates, containing terms which are divided by sums, into TikZ. For instance, I would like to use something with a similar syntax to this: \def \cmd {1/(1+...
• 205
64 views

### Tikz Display Coordinate in Node Text in Scaled Picture

Looking to display the value of a coordinate, however using the below, the value does not print out accurately. The scale is attempted to be retreived using Recover scaling factor in TikZ and then use ...
• 411
31 views

### Draw a three dimensional sphere with TikZ that looks like this [duplicate]

I would like to draw a simple sphere with radius 1 in a three dimensional coordinate system that has some kind of grid on its surface, i.e. like in the following picture that I found. I was wondering ...
• 101
1 vote
44 views

### LaTeX Error: Illegal parameter number in pgfplots coordinate list

I am experiencing a persistent error when trying to compile a pgfplots scatter plot in LaTeX. The error message I receive is: ./test.tex:23: Illegal parameter number in definition of \pgfmaththisrow@....
• 377
105 views

### Intersection -| of a named and a calculated coordinate

I want to use the intersection of a named and a calculated coordinate, in other words the y-coordinate of a named coordinate but the x-coordinate of a calculated coordinate, such as the point Z below, ...
• 2,850
30 views

### TikZ: collecting defined coordinates in a list

I want to collect previously defined coordinates in a list and print them later in a \foreach-loop for debugging purposes. The following MWE shows the list \points which ideally should be defined and ...
92 views

### PGF is extracting wrong x/y values from a coordinate. How can I extract correct values?

Consider this MEW, \nonstopmode \documentclass{article} \usepackage{tikz,amsmath} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \draw [gray!10](-...
• 625
1 vote
30 views

### A simple question about mfpic coordinates

I'm learning a little mfpic. I have the following code that draws just a line and I just need to know the meaning of the coordinates: [15]{-7}{6}{-3}{3} \documentclass{article} \usepackage[metapost]{...
• 93
82 views

### PGFPlots: How to properly get the x-component value of a coordinate to use it in a calculation?

How to fix the syntax of \draw (i-2) circle let \p{dgcr} = (i-2) in node at (i-2) {$d_{g,cr} = \fpeval{\x{dgcr}/0.35}$}; to make the node calculated number correct (i.e., it should be around 0.6, not ...
• 9,679
107 views

### Circuitikz - aligning nodes

I was drawing circuit in tikz and find problem. First problem: I am not able to align verticaly open nodes on the left. Is there simple solution for that? Second problem: Is there way to get for ...
• 33
44 views

### Default unit for x,y components of tikzmath coordinate is in pt

Lets say I want to draw a line on a grid given two points A,B: \documentclass[tikz]{standalone} %mixing defs and coordinates is a bad idea \usetikzlibrary{fit,shapes,calc,matrix,math,positioning,...
• 453
142 views

### How to pass a \def coordinate to macros

I am trying to pass a \def coordinate to a macro and got an error. Below is the code. The macro with direct passing works, but the two commented out lines don't. \documentclass[border=1cm]{standalone} ...
• 253
1 vote
104 views

### Why doesn's naming coordinate with \foreach iterator work inside axis environment?

Without the axis environment, we can write something like this \documentclass[beamer,crop]{standalone} \usepackage{pgfplots} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \foreach \...
• 1,006
1 vote
174 views

### Feynman Diagrams inside circles

I'm trying to use tikz-feynman to draw Feynman diagrams encased in circles. I need the entire diagram to be inside a circle, with the lines touching the circle. This is necessary because these are ...
• 141
69 views

### Why can't I use coordinate in coordinates?

In \documentclass[beamer,crop]{standalone} \usepackage{times} \usepackage{physics} \usepackage{pgfplots} \usetikzlibrary{calc} \pgfplotsset{ compat=1.17, % Specify the compatibility version ...
• 1,006
194 views

### Roundoff error in the yticks

The following MWE \documentclass[beamer,crop]{standalone} \usepackage{times} \usepackage{pgfplots,xparse} \pgfplotsset{ compat=1.17, % Specify the compatibility version nice_axis/.style={ ...
• 1,006
85 views

### tkz-fct: Define function in correct coordinates when axes have non-trivial step size

Consider the following example: \documentclass[12pt,a4paper]{article} \usepackage{pgfplots} \usepackage{tkz-base} \usepackage{tkz-fct} \begin{document} \begin{tikzpicture}[scale=0.8] \...
• 265
37 views

### page coordinate vs TeX coordinate

I am reading the synctex source code, now I found he comment mentioned two type of coordinates, page coordinates and TeX coordinates. anyone know about the two type of coordinate system? The docs only ...
• 865
1 vote
59 views

### tdplotsetrotatedcoord ' arguments

This involves making a pyramid (tetrahedral, SABCD) in a red reference frame of origin (A) = (0,0) and dimension 2 cm then tracing a green triangle on the face ((S), (B), (C)) for this it would ...
52 views

### Drawing between plots with groupplots pgfplots

I am trying to create a zoom effect for the plot on the left. I make a box in it and I want to draw lines from two corners of the rectangle going to the plot on the right. I thought it might be ...
• 41
67 views

### I cannot define tikz coordinate with foreach statement

I got a weird bug when I want to define and name a list of coordinates \tikz{ \foreach \name/\pos in {{a/(1,0)}, {b/(0,1)}} \coordinate (\name) at \pos ; } The error is {/usr/local/texlive/2023/...
77 views

### Place element at each corner of minipage

General overview I try to put different elements on each corner of a minipage. MWE \documentclass[a4paper,12pt]{article} \usepackage{graphicx} \usepackage{picture} \usepackage{calc} \begin{document} ...
• 2,531
1 vote
52 views

### Pgfplot coordinates declared in \addplot

I am trying to plot data from a .csv with different data sets (no more than 4). I have added some additional input parameters just for debugging, at the moment the document looks like this: \...
37 views

### Intersection coordinates change when I change values for domain

I'm trying to plot a function using Tikz/Pgfplots. Am still new to using Tikz/Pgfplots. I've created the code using various sources. Here's a MWE: \documentclass{standalone} \usepackage{pgfplots,tikz}...
• 113
91 views

### Tikz: Moving the origin to a polar coordinate

Reading the documentation, I was under the impression that “++” changes the origin to that point. At the same time, I understand that a polar coordinate specifies a certain point by giving the angle ...
• 153
60 views

### Why does my \includegraphics size not match the length of the coordinate system after setting the height and width?

mycode is like this: \documentclass{article} \usepackage{tikz} \usetikzlibrary{3d} \begin{document} \begin{tikzpicture} \node[canvas is zy plane at x=0mm] (temp) at (0.0mm,0.0mm,0.0mm) {\...
• 1
1 vote
91 views

### How to delete duplicate points in computer generated tikz image

I used an svg file of an image as the basis for a program (this one, I think) to generate a tikz version of the image. The tikz code it produced compiles correctly and the image looks good, but the ...
• 149
161 views

### Plotting coordinates from tikzmath in pgfplot axis coordinate system

Short Version I want to do some fairly complicated coordinate math to make a notional diagram but would like to use pgfplots since I have used it elsewhere in my document and want the axis styles (...
• 103
1 vote
39 views

### LaTeX reserving space for undrawn coordinates

I'm trying to write a function to ease the drawing of figures. I called this function \drawcurve as is shown below. It's purpose is to create a curve between 2 lines indicated by coordinates in it's ...
1 vote
1k views

### Simple way to position a text anywhere on a beamer frame

This might be a very easy question but somehow I have failed to find a good answer for. I wish to put a text, e.g., word/math/string, etc. on a specific location on a Beamer frame. This is probably ...
• 3,159
476 views

### Find the coordinates of a point in a TikZ picture, with respect to the borders drawn by standalone package

Consider a TikZ picture with a circle centred at (0,0) in the TikZ coordinate system. Surrounding the node is a complex shape, such as a curve as shown below. In the standalone package, the border is ...
• 113
1 vote
34 views

### tikzmath produces an error when the trigonometric functions are used [duplicate]

Why does the following code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{math} \begin{document} \begin{tikzpicture} \tikzmath{ coordinate \v; \v = (cos(pi),sin(pi)); } \end{...
• 11.1k
1 vote
133 views

### How to draw nodes from a txt file using tikz

So basically, I have a tikzpicture and I would like to include 36 node inside this picture. currently, the only way I know to include them is to write \filldraw[blue] (3.8,3.6) circle (1pt) node[...
33 views

### How can I write (xyz) coordinates in LaTeX? [duplicate]

After looking online, I can't seem to find a command to replicate coordinate notation as shown in the image below. Any help would be appreciated.
301 views

### How do I add gray grid lines to a three-dimensional plot using pgfplots?

I am trying to use pgfplots to draw a three-dimensional space. Using the following code I'm able to get the axes to show, and I know how to add coordinates and nodes and some other objects: \...
48 views

### TikZ - foreach substitution inside coordinate name not working [closed]

I have coordinates named a1 to a9. They were defined by \coordinate (a1) at (0,0); etc. They all have valid x and y coordinates. I need to create 9 circles whose centers are each of the 9 coordinates ...
636 views

### Positioning a minipage [duplicate]

I would like to choose exactly where my minipage starts using coordinates on the page. So far I have the following, \documentclass{article} \begin{document} \begin{minipage}[x=10cm,y=5cm]{8em} The ...
• 293
126 views

### Foreach with different label

Is there a simple way to have display my coordinate system? \begin{tikzpicture} \draw [-latex,thick] (0,0)--(12.5,0); \draw [-latex,thick] (0,0)--(0,10.5); \foreach \y in{2,...
111 views

### tikzmath arithmetic calculations using predefined variables

I'm trying to do calculations in tikzmath using some predefined variables. Here's an example of what I have \usepackage{tikz} \usetikzlibrary{math} \begin{tikzpicture} \tikzmath{ real \ang = 30; ...
• 115
1 vote
92 views

### Define a tikz variable only inside the current tikzpicture

I want to "define" a variable inside my tikzpicture. This answer gives a solution for how to do that, using the math library. The thing I am concerned with is that when I assign \x1 the ...
• 1,145
153 views

### Why do two different TikZ pictures report different coordinates for the center of the page?

I saved the following LaTeX code in ~/Test.tex. \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \tikz[remember picture, overlay] \draw let \p1=(current page.center)...
• 11.1k
79 views

### Avoid axes distortion when drawing on image in tikz

I want to draw 10 circles in a circular shape, inside a rectangle. The problem is that the 10 circles are positioned as an ellipse, and not around the circumference of a circle. I want to place the 10 ...
• 1,145
50 views

### How to assign a value of the form (my node.east) to a coordinate variable inside the argument of a tikzmath command?

The PGF & TikZ manual for version 3.1.9a (the current version) has this to say about the coordinate keyword of the math TikZ library (p. 706): coordinate 〈variable〉, 〈additional variables〉; This ...
• 11.1k
164 views

### Diagonal coordinate grid Tikz

I am looking to make a coordinate grid with a (darker) diagonal grid (with potentially different grid length) on top of it as in the image below. I.e I would like to have a tikz image of the ...
• 113
90 views

### pgfplots: tick-labels at the end of the ticks

I have a y-axis. What do I have to set, to get the tick-labels at the end of the ticks? BTW: I would like to have a 'zero' axis what do I have to set for this? It seems I will need: axis lines*=...
• 8,388
117 views

### pgfplots: place second y-axis at fixed x-position

I have a second y-axis, that is a '(purple) q-axis'. What do I have to set to place the second y-axis through (1,0) at the original coordinate system (black). \documentclass[margin=5pt, tikz]{...
• 8,388