Why does a perfectly-identical repetition of a drawing command given within an earlier loop 𝘯𝘰𝘵 produce exactly the same line?Does TikZ use the same internal mechanism as PSTricks to produce vector based pdf outputs?Reuse of soft path in fading declaration? Transformation of fadings?Why does cleveref's crefname command have no effect when it appears within a foreach?Why does this pgfmathparse not work outside the foreach loop?tikz draws line in wrong place (2 pages above its definition)Why does “fill opacity” affect nodes in the same path?Tikz: Is it possible to change line style within same draw command?`latex` and `pdflatex` produce different colors given the same TikZ pictureWhy is prooftrees putting everything on the same line?Omit the same coordinate parameters in drawing line in tikz
In general, would I need to season a meat when making a sauce?
Why do most published works in medical imaging try to reduce false positives?
Why aren't space telescopes put in GEO?
Is real public IP Address hidden when using a system wide proxy in Windows 10?
the meaning of 'carry' in a novel
Pirate democracy at its finest
What was the idiom for something that we take without a doubt?
Did people go back to where they were?
How to execute this code on startup?
Is it true that cut time means "play twice as fast as written"?
Binary Search in C++17
Does the unit of measure matter when you are solving for the diameter of a circumference?
Make 24 using exactly three 3s
Computing the matrix powers of a non-diagonalizable matrix
Plot twist where the antagonist wins
Why do Windows registry hives appear empty?
Find limit in use of integrals
Would jet fuel for an F-16 or F-35 be producible during WW2?
My employer faked my resume to acquire projects
How to respond to an upset student?
How to know if a folder is a symbolic link?
What are the real benefits of using Salesforce DX?
German equivalent of the French expression "Mais de là à ..."
Which is the common name of Mind Flayers?
Why does a perfectly-identical repetition of a drawing command given within an earlier loop 𝘯𝘰𝘵 produce exactly the same line?
Does TikZ use the same internal mechanism as PSTricks to produce vector based pdf outputs?Reuse of soft path in fading declaration? Transformation of fadings?Why does cleveref's crefname command have no effect when it appears within a foreach?Why does this pgfmathparse not work outside the foreach loop?tikz draws line in wrong place (2 pages above its definition)Why does “fill opacity” affect nodes in the same path?Tikz: Is it possible to change line style within same draw command?`latex` and `pdflatex` produce different colors given the same TikZ pictureWhy is prooftrees putting everything on the same line?Omit the same coordinate parameters in drawing line in tikz
Question. Why does the following code produce a line from vertex 0 to vertex 1 which does not perfectly coincide with the analogous line drawn earlier (by way of the foreach-loop)?
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
node (vn) at (a:r pt) [];
foreach n in 0,1,2,3,4
pgfmathsetmacroauxoneMod(n,5);
pgfmathsetmacroauxtwoMod(add(n,1),5);
pgfmathsetmacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
The offending output is the following:
Remarks.
My wish is to have the second line from 0 to 1 coincide perfect with the previously drawn one (and hence create a darker hue, because of the superposition of two opacity-0.5-lines).
I fail to see any reason for the non-congruence of the two lines. (If one mentally substitues the variables auxone and auxtwo, then the two drawing-commands in question seem perfectly identical to me, hence can be expected to have exactly the same effect.)
I tried to exchange the line
draw[opacity=0.5] (v0)--(v1);
with the line
draw[opacity=0.5] (v0.center)--(v1.center);
producing a slighly different, yet still unexplained and undesirable, result, which I permit myself to also reproduce (in the hope that this might help someone understand the problem):
tikz-pgf foreach technical-drawing tikz-graphdrawing
add a comment |
Question. Why does the following code produce a line from vertex 0 to vertex 1 which does not perfectly coincide with the analogous line drawn earlier (by way of the foreach-loop)?
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
node (vn) at (a:r pt) [];
foreach n in 0,1,2,3,4
pgfmathsetmacroauxoneMod(n,5);
pgfmathsetmacroauxtwoMod(add(n,1),5);
pgfmathsetmacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
The offending output is the following:
Remarks.
My wish is to have the second line from 0 to 1 coincide perfect with the previously drawn one (and hence create a darker hue, because of the superposition of two opacity-0.5-lines).
I fail to see any reason for the non-congruence of the two lines. (If one mentally substitues the variables auxone and auxtwo, then the two drawing-commands in question seem perfectly identical to me, hence can be expected to have exactly the same effect.)
I tried to exchange the line
draw[opacity=0.5] (v0)--(v1);
with the line
draw[opacity=0.5] (v0.center)--(v1.center);
producing a slighly different, yet still unexplained and undesirable, result, which I permit myself to also reproduce (in the hope that this might help someone understand the problem):
tikz-pgf foreach technical-drawing tikz-graphdrawing
add a comment |
Question. Why does the following code produce a line from vertex 0 to vertex 1 which does not perfectly coincide with the analogous line drawn earlier (by way of the foreach-loop)?
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
node (vn) at (a:r pt) [];
foreach n in 0,1,2,3,4
pgfmathsetmacroauxoneMod(n,5);
pgfmathsetmacroauxtwoMod(add(n,1),5);
pgfmathsetmacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
The offending output is the following:
Remarks.
My wish is to have the second line from 0 to 1 coincide perfect with the previously drawn one (and hence create a darker hue, because of the superposition of two opacity-0.5-lines).
I fail to see any reason for the non-congruence of the two lines. (If one mentally substitues the variables auxone and auxtwo, then the two drawing-commands in question seem perfectly identical to me, hence can be expected to have exactly the same effect.)
I tried to exchange the line
draw[opacity=0.5] (v0)--(v1);
with the line
draw[opacity=0.5] (v0.center)--(v1.center);
producing a slighly different, yet still unexplained and undesirable, result, which I permit myself to also reproduce (in the hope that this might help someone understand the problem):
tikz-pgf foreach technical-drawing tikz-graphdrawing
Question. Why does the following code produce a line from vertex 0 to vertex 1 which does not perfectly coincide with the analogous line drawn earlier (by way of the foreach-loop)?
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
node (vn) at (a:r pt) [];
foreach n in 0,1,2,3,4
pgfmathsetmacroauxoneMod(n,5);
pgfmathsetmacroauxtwoMod(add(n,1),5);
pgfmathsetmacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
The offending output is the following:
Remarks.
My wish is to have the second line from 0 to 1 coincide perfect with the previously drawn one (and hence create a darker hue, because of the superposition of two opacity-0.5-lines).
I fail to see any reason for the non-congruence of the two lines. (If one mentally substitues the variables auxone and auxtwo, then the two drawing-commands in question seem perfectly identical to me, hence can be expected to have exactly the same effect.)
I tried to exchange the line
draw[opacity=0.5] (v0)--(v1);
with the line
draw[opacity=0.5] (v0.center)--(v1.center);
producing a slighly different, yet still unexplained and undesirable, result, which I permit myself to also reproduce (in the hope that this might help someone understand the problem):
tikz-pgf foreach technical-drawing tikz-graphdrawing
tikz-pgf foreach technical-drawing tikz-graphdrawing
asked 9 hours ago
Peter HeinigPeter Heinig
38318
38318
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Because you were using pgfmathsetmacro
, which adds .0
at the end of the numbers, which get interpreted as anchors (.0
is equivalent to .east
in this case). If you use pgfmathtruncatemacro
instead the lines match perfectly, as they should.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
node (vn) at (a:r pt) [];
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
If you want to close the gaps, you may want to use coordinate
s instead of node
s.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
coordinate (vn) at (a:r pt);
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f492625%2fwhy-does-a-perfectly-identical-repetition-of-a-drawing-command-given-within-an-e%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Because you were using pgfmathsetmacro
, which adds .0
at the end of the numbers, which get interpreted as anchors (.0
is equivalent to .east
in this case). If you use pgfmathtruncatemacro
instead the lines match perfectly, as they should.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
node (vn) at (a:r pt) [];
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
If you want to close the gaps, you may want to use coordinate
s instead of node
s.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
coordinate (vn) at (a:r pt);
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
add a comment |
Because you were using pgfmathsetmacro
, which adds .0
at the end of the numbers, which get interpreted as anchors (.0
is equivalent to .east
in this case). If you use pgfmathtruncatemacro
instead the lines match perfectly, as they should.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
node (vn) at (a:r pt) [];
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
If you want to close the gaps, you may want to use coordinate
s instead of node
s.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
coordinate (vn) at (a:r pt);
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
add a comment |
Because you were using pgfmathsetmacro
, which adds .0
at the end of the numbers, which get interpreted as anchors (.0
is equivalent to .east
in this case). If you use pgfmathtruncatemacro
instead the lines match perfectly, as they should.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
node (vn) at (a:r pt) [];
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
If you want to close the gaps, you may want to use coordinate
s instead of node
s.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
coordinate (vn) at (a:r pt);
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
Because you were using pgfmathsetmacro
, which adds .0
at the end of the numbers, which get interpreted as anchors (.0
is equivalent to .east
in this case). If you use pgfmathtruncatemacro
instead the lines match perfectly, as they should.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
node (vn) at (a:r pt) [];
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
If you want to close the gaps, you may want to use coordinate
s instead of node
s.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
foreach n/a/r in 0/0/100,1/72/100,2/144/100,3/216/100,4/288/100
coordinate (vn) at (a:r pt);
foreach n in 0,1,2,3,4
pgfmathtruncatemacroauxoneMod(n,5);
pgfmathtruncatemacroauxtwoMod(add(n,1),5);
pgfmathtruncatemacroauxthreeMod(add(n,2),5);
draw[opacity=0.5] (vauxtwo)--(vauxone);
draw[opacity=0.5] (vauxthree)--(vauxone);
draw[opacity=0.5] (v0)--(v1);
endtikzpicture
enddocument
answered 9 hours ago
marmotmarmot
130k6164312
130k6164312
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f492625%2fwhy-does-a-perfectly-identical-repetition-of-a-drawing-command-given-within-an-e%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown