Skip to main content

All Questions

Filter by
Sorted by
Tagged with
4 votes
1 answer
67 views

Calculated coordinates in TikZ-Paths

I require coordinates in a TikZ-path, which are calculated from values in a table or in a csv-file. Therefore I cannot create the coordinates using the calc-library but have to incorporate additional ...
Wilhelm Haager's user avatar
1 vote
1 answer
168 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 ...
tush's user avatar
  • 1,211
2 votes
1 answer
86 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 ...
tush's user avatar
  • 1,211
3 votes
1 answer
319 views

Changing the default length unit in tikz

Is there a way to change the default length unit in tikz to the ex unit? I have trouble while calculating complicated coordinates in tikz when I'm using the ex unit (I always get an error or a wrong ...
Master.AKA's user avatar
0 votes
1 answer
450 views

Using Tikz package to extracting length, coordinates and assigning them to variables

The code below is extracted from: "\internalforces" command in stanli package (code exam1b - The second coding set in this example) and Using reference points in "Stanli" Is there ...
Silva's user avatar
  • 763
10 votes
3 answers
2k views

Tikz: Calculate and store the Euclidian distance between two coordinates

Is there an easy way to store the Euclidian distance between two coordinates? I want to store the value 4 in a macro, so that I can use it to specify the width of a node. The easiest way I could ...
Florian's user avatar
  • 515
3 votes
1 answer
1k views

pgfplots: drawing multiple vectors with corresponding unit vectors

Suppose you have a couple of 3D-vectors given by their start and endpoints. Now you want to define a command that draws one of these vectors together with its respective unit vector from the same ...
F. Preiss's user avatar
4 votes
1 answer
735 views

Using a macro inside a Tikz coordinate calculation

I am trying to create a general macro that prints a particular custom character, based on an answer to a previous question of mine. Here is a minimal (non-)working example: %!TEX encoding = UTF-8 ...
Ptharien's Flame's user avatar
3 votes
1 answer
2k views

Tikz coordinate calculations inside foreach

As part of a drawing that will go with an explanation of diffraction, I want to draw the "outer rays" of a beam of light and draw several rays in between. An MWE of how I'm going about this is shown ...
Wouter's user avatar
  • 541
2 votes
1 answer
644 views

Tikz 3d trimetric view coordinate calculation bug

I'm trying to draw a line in the x-y-plane and circles in the y-z-plane at constant x position. Problem is, that the circle is far out of position (x-coordinate of center point of the circle is ...
user3116388's user avatar
1 vote
1 answer
1k views

Tikz: How to combine orthogonal edge syntax with coordinate calculation? [duplicate]

I'm trying to combine the syntax for orthogonal edges (p |- q) with the syntax for calculation relative coordinates ($ (a) + (1,0) $). Example: \draw ($ (node1.south) + (1,0) $) to ( ($ (node1.south) ...
bluenote10's user avatar
  • 1,539
3 votes
1 answer
1k views

Apply shift to (current axis.left of origin)

I was trying to improve the solution at Drawing lines in a plot and give them a label? by using Jake's answer at How to access \xmin, \xmax, \ymin, \ymax from within PGFplots axis environment. So, ...
Peter Grill's user avatar
1 vote
1 answer
609 views

How do I store the x or y value of a named node in tikz \draw?

A big part of the question above has already been answered: "Use the calc tikzlibrary and the let syntax". \begin{tikzpicture} \draw [help lines] (0,0) grid (4,4); \node (A) at (2,1) {A}; \path ...
Kit's user avatar
  • 17k
17 votes
2 answers
2k 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 ...
Fritz's user avatar
  • 6,373
17 votes
2 answers
7k 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 ...
eudoxos's user avatar
  • 3,033
47 votes
3 answers
20k 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 ...
Dror's user avatar
  • 22.9k
39 votes
2 answers
29k 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 \usetikzlibrary{...
hpekristiansen's user avatar