Questions tagged [tikz-calc]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

Problem with \tikzdeclarecoordinatesystem

I create a new coordinate system with \tikzdeclarecoordinatesystem. Compiles true when scale=1 and false otherwise. Why? Can you help me? Thanks alot. This is my code. \documentclass[tikz, border=2mm]{...
3
votes
2answers
71 views

Weird Tikz positioning behaviour; calc, \graph, subgraph

I have the following code. It behaves as expected when only one middle node is drawn; however, when both are there the result is surprising. Why is that? How can I fix it? \documentclass[border=2mm]{...
1
vote
2answers
68 views

TikZ: fill a percentual part of a rectangle node

I have a rectangle node, say 2cm times 3cm. Is there a TikZ-like way to fill a percent value, say p, of that rectangle, similar as shown in the picture (for 34.5%). So the yellow area shall be e.g. ...
0
votes
1answer
59 views

Recursive function in pgfplots

I'm trying to plot Legendre polynomials, which can be done very easily by calling a recursive function. For instance, in Python this would like like this: def legendre(xi, p): if p==0: ...
3
votes
1answer
153 views

Draw Arcs On Spherical Caps With Fill

I asked this question: Draw Arcs On Spherical Caps and a user was kind to answer. However, I am trying to improve on design by changing some colors, adding fill, and adding coordinate (x,y,z) axis ...
1
vote
1answer
33 views

How to calc coordinates of a middle of calculated segment?

\documentclass[12pt]{scrartcl} \usepackage{pgfplots} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \coordinate (a) at (-2,5); \coordinate (b) at (-2,0); \...
3
votes
1answer
55 views

Using tikz-calc addition of coordinates along with macros

I am trying to use tikz-calc to automatically calculate coordinates in custom macros, using the coordinate addition function ($ (x,y) + (a,b) $). Things seem to go awry when I try to add coordinates ...
1
vote
2answers
45 views

how to draw n horizontal y-axis parallel lines intersect m vertical x-axis parallel lines

use \foreach command add node circle \begin{tikzpicture}[scale=0.5] \draw[->] (-10, 0) -- (10, 0) node[right] {$x$}; \draw[->] (0, -10) -- (0, 10) node[above] {$y$}; { \foreach \n in {8,7,...
4
votes
3answers
394 views

Calculation summations in Latex

Anyone can help me please? I need to calculate the sum 1+1/2+1/3+...1/n (n given) by using only Latex commands. I have no idea how can I do this. Many thanks.
1
vote
1answer
61 views

tipfr package: how to write some buttons (request: only pdfLaTeX)

Related of this my previous question here: Search for a package to generate graphic displays of calculators I'm searching to write something as \sin^{-1} for my students similar to this picture taken ...
5
votes
2answers
435 views

TikZ: Get (dimensionless) distance between node anchors

In the following picture I want node C to be as wide as the distance between (A.north east) and (B.south west) as indicated in the picture; I tried defining a new node D with \n1 as minimum width, and ...
2
votes
2answers
226 views

Tangent Circles using TikZ

I am trying to use TikZ to draw tangent circles contained in a rectangle, but I have encountered some difficulties. I am also soliciting general feedback on using TikZ better, so I am giving a fair ...
2
votes
1answer
52 views

Tikz, error in computation of coordinates

I would like to draw 3 vectors starting at (m) and with computed length, but things go wrong. Basically I get an error or a rendering error (according to the differend attempts) in the 1st and 3rd ...
3
votes
2answers
169 views

Expansion of “\coord” macro in TikZ “let” command

Please consider this code: \documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \def\coord(#1){coordinate(#1)} \begin{document} \begin{tikzpicture} \node[draw](A) at (...
3
votes
1answer
125 views

tikz arithmetic with numbers and lengths

Consider this example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \def\starty{3} \def\length{1}; \coordinate(a1) at (1, \starty); \...
2
votes
1answer
109 views

Can tikz projections be computed in three dimensions?

According to the pgf manual, the syntax <coordinate>!<projection coordinate!<angle>:<second coordinate> can be used to project <projection coordinate> orthogonally onto ...
6
votes
1answer
367 views

best way to draw planes in 2d?

I would like to replicate the following image and I would like to know how to represent the third state into the page by using the tikz-3dplot package, maybe starting from the answer to a previous ...
1
vote
0answers
52 views

How to Calculate x-Position in a pgfplots with Information from a Table

Situation and Problem This question is a follow-up and based on marmots answers to this question and this. The general situation is described there. Now I want to simplify input. More specifically I ...
2
votes
1answer
413 views

Drawing a set with a particular shape

I would like to draw a non-convex set as in the following image and I like to start from my MWE: \documentclass[12pt,a4paper]{book} \usepackage{tikz} \usetikzlibrary{calc, shadings} \usetikzlibrary{...
3
votes
1answer
89 views

Dynamic bar plot from file

I need to draw a bar chart based on the data from the file. The data looks something like this \begin{filecontents*}{tls.dat} Name Abbreviation percentage Bod-Kin LS1 60 Intraper LS2 40 ...
2
votes
1answer
61 views

Defining intersections and nodes

I've replicated the figure below through the following MWE \documentclass[12pt,a4paper]{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[dot/.style={circle,...
5
votes
2answers
287 views

Drawing perpendicular lines, filling areas

I still have some trouble with perpendicular lines. This is the figure I'd like to replicate This is my MWE \documentclass[12pt,a4paper]{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{...
2
votes
1answer
2k views

Drawing a simple plane in 3D space

I'm trying to produce this simple 3d picture, but, since it's the first time I draw a 3d pic, I'm not sure about how to get the plane passing through the line X. The following code shows a first ...
4
votes
2answers
302 views

Intersections in Tikz

The following code produces , however I would like to highlight the intersection area between the line through the coordinates A and B and that perpendicular to the vector x.3, defined in the \...
3
votes
1answer
252 views

Drawing lines using \foreach

I'd like to get a picture similar to that uploaded below. Basically, I'm trying to add perpendicular lines to every ray on the positive orthant. This is my attempt, could you tell me what is wrong in ...
2
votes
2answers
125 views

Tips for improving a code

I'm trying to replicate the following figure. This is my attempt, but I want to get something more precise. \documentclass[12pt,a4paper]{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{...
3
votes
1answer
63 views

Adding some simple labels

Since I am a beginner with Tikz, I wanted to ask what is the best way to include labels to my lines, as in the picture: This is the code: \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{...
1
vote
2answers
609 views

How to add ticks in a circle in TikZ

Referring to the question How to make add tick to node in tikz, how do I extend this to a circle shape in TikZ. A simple approach is to draw lines as ticks by calculating the coordinates. Sample ...
1
vote
1answer
85 views

Plotting my chart incorrectly in tikz

MWE \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{datavisualization} \usetikzlibrary{datavisualization.formats.functions} \usetikzlibrary{patterns,backgrounds} \def\mytypesetter#1{ \...
0
votes
1answer
903 views

How to draw animated isomorphic graphs?

I saw a nice question & answer over here, about creating an animation to demonstrate graph isomorphism. I'd like to do the same for these two examples: These two are isomorphic: These two aren't ...
2
votes
1answer
202 views

How to remove unit from variable?

I want to draw an arc of a certain length in cm, so I divide by the circumference in cm and multiply 360 to get the segment in degrees. (Is there a shortcut?) In my MWE b is the unitless number I want ...
6
votes
1answer
209 views

Calculations within Matrix Tikz

How can I tell tikz to make a calculation within a matrix. The same syntax outside does not work within as is shown in this MWE: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,calc} ...
4
votes
1answer
141 views

Let Tikz do the Calculating

Most of the work has been done here except I want TiKz to calculate the y values at least. I try here below but need help with the syntax to finish \documentclass{article} \usepackage{tikz} \...
7
votes
5answers
2k views

TikZ: Understanding the usage of calc library

For the following MWE, I need to place block (yaw) {C} midway between (1) the middle point between (output) and (integrator) (2) and (sum2). So, how can I correct this syntax \node [block] (yaw) at ([...
4
votes
2answers
83 views

substitution in tikz calc

In this example \documentclass[tikz,border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \coordinate (a) at (0, 0); \coordinate (b) at (1, 1); \...
3
votes
3answers
220 views

Using calc library with background package

Im trying to place a page border on every page using ornaments and the background package. I'd like to place this frame 0.6cm away from the border of the page and therefore I'm using the calc library ...
3
votes
1answer
54 views

TikZ, avoiding uneccessary ad-hoc coordinates calculation

I am wondering whether there would be a simpler way to get a similar figure: (1) avoid adjusting by hand the size of each coloured box, (2) avoid computing by hand the middle of each box from which ...
3
votes
1answer
366 views

Relative positioning of nodes to bounding box and to path operation

I just tried to use the relative positioning of nodes with respect to the current bounding box of a tikzpicture as proposed in Position node relative to current bounding box. The proposed solution ...
2
votes
1answer
572 views

Pgfplots: how to have “let” retrieve coordinates in the axis coordinate system? [duplicate]

This is a continuation of my previous question, but now I want to use pgfplots. In an axis environment, I add a node using the axes coordinate system. I would like to use let to retrieve the ...
6
votes
3answers
528 views

Spin Echo Diagram, Simplification and Scalability

I was able to create the following diagram of a spin echo sequence (NMR, NQR spectroscopy) using TikZ: It was produces using this code snippet: \begin{tikzpicture} \coordinate (yoffset) at (...
6
votes
2answers
277 views

Can we use `let` (from `TikZ`) inside a node's style definition?

I know how to use let from TikZ calc library into a path command and fix some parameter of a particular node on that path. But I would like to use inside node's style definition. As an example, ...
2
votes
1answer
303 views

Using a custom command inside Tikz-Calc

This my first question here, so I hope that I present it in an appropriate form. At the moment I'm generating lots of schematics using the TikZ-package and it's calc-Library. Therefore I use ...
2
votes
1answer
430 views

Tikz foreach loop and coordinate computation including scaling

I am trying to plot a number of lines from a point on the segment connecting points from a given list of points to the coordinate origin (0,0). Since I want to automate this procedure, I am using \...
4
votes
1answer
179 views

Combined rotations in tikz

How to make the center of a rotation in tikz evolve in a for loop, given a trigonometrical formula (that I reckon should be quite simple: l*cos and l*sin)? I am trying to make a scheme of the arm ...
1
vote
2answers
133 views

Conflict between personal macro and Babel French

I wrote a personal command that allows you to place a text next to a figure. This macro has been corrected for an incompatibility with the tikz calc library here: Personal command incompatible with ...
2
votes
1answer
144 views

Personal command incompatible with beamer class

On these thread: Personal command incompatible with tikz calc library the personal \compo command that allows you to place a figure next to a text has been corrected to work with the tikz calc library ...