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













4















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:



enter image description here



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):



enter image description here










share|improve this question


























    4















    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:



    enter image description here



    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):



    enter image description here










    share|improve this question
























      4












      4








      4


      1






      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:



      enter image description here



      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):



      enter image description here










      share|improve this question














      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:



      enter image description here



      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):



      enter image description here







      tikz-pgf foreach technical-drawing tikz-graphdrawing






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 9 hours ago









      Peter HeinigPeter Heinig

      38318




      38318




















          1 Answer
          1






          active

          oldest

          votes


















          6














          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


          enter image description here



          If you want to close the gaps, you may want to use coordinates instead of nodes.



          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


          enter image description here






          share|improve this answer























            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
            );



            );













            draft saved

            draft discarded


















            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









            6














            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


            enter image description here



            If you want to close the gaps, you may want to use coordinates instead of nodes.



            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


            enter image description here






            share|improve this answer



























              6














              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


              enter image description here



              If you want to close the gaps, you may want to use coordinates instead of nodes.



              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


              enter image description here






              share|improve this answer

























                6












                6








                6







                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


                enter image description here



                If you want to close the gaps, you may want to use coordinates instead of nodes.



                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


                enter image description here






                share|improve this answer













                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


                enter image description here



                If you want to close the gaps, you may want to use coordinates instead of nodes.



                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


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 9 hours ago









                marmotmarmot

                130k6164312




                130k6164312



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                    Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                    Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її