Naming intersection points of a grid












2















How can I give names to all intersection points of a grid, so that I can draw from a specific intersection to another. So when changing the xstep/ystep measures the drawing refers to the new intersection positioning not the absolute coordinates.



In my example, when changing the xstep/ystep measures the drawings remain in their positions and do not change with the xstep/ystep measures.



So I want to draw from intersection a to intersection b, not from position (1,1) to (2,2); and from intersection x to intersection z, not from position (3,3) to (4,3)



Can this be done without using an extra package, because I can not install new packages (on my workplace computer) for security reasons.



documentclass{beamer}
setbeamertemplate{navigation symbols}{}
usepackage{tikz}
usepackage{pgfplots}
begin{document}
begin{frame}[t]
frametitle{N}
begin{center}
begin{tikzpicture}
draw[step=.5cm,color=gray] (0,0) grid (8,8);
draw<2->[ultra thick, green, -latex] (1,1) -- (2,2);
draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (3,3) circle (.2cm) node (c){};
draw<3->[ultra thick, red, -latex] (c.center) -- (4,3);
node at (1,1){a};
node at (2,2){b};
node at (3,3){x};
node at (4,3){z};
end{tikzpicture}
end{center}
end{frame}
end{document}


enter image description here










share|improve this question























  • @marmot Thank you for your comment, but I do not want to change the x/y scaling. This is an MWE not the whole drawing. There are other drawings in other intersections.

    – Hany
    2 hours ago


















2















How can I give names to all intersection points of a grid, so that I can draw from a specific intersection to another. So when changing the xstep/ystep measures the drawing refers to the new intersection positioning not the absolute coordinates.



In my example, when changing the xstep/ystep measures the drawings remain in their positions and do not change with the xstep/ystep measures.



So I want to draw from intersection a to intersection b, not from position (1,1) to (2,2); and from intersection x to intersection z, not from position (3,3) to (4,3)



Can this be done without using an extra package, because I can not install new packages (on my workplace computer) for security reasons.



documentclass{beamer}
setbeamertemplate{navigation symbols}{}
usepackage{tikz}
usepackage{pgfplots}
begin{document}
begin{frame}[t]
frametitle{N}
begin{center}
begin{tikzpicture}
draw[step=.5cm,color=gray] (0,0) grid (8,8);
draw<2->[ultra thick, green, -latex] (1,1) -- (2,2);
draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (3,3) circle (.2cm) node (c){};
draw<3->[ultra thick, red, -latex] (c.center) -- (4,3);
node at (1,1){a};
node at (2,2){b};
node at (3,3){x};
node at (4,3){z};
end{tikzpicture}
end{center}
end{frame}
end{document}


enter image description here










share|improve this question























  • @marmot Thank you for your comment, but I do not want to change the x/y scaling. This is an MWE not the whole drawing. There are other drawings in other intersections.

    – Hany
    2 hours ago
















2












2








2








How can I give names to all intersection points of a grid, so that I can draw from a specific intersection to another. So when changing the xstep/ystep measures the drawing refers to the new intersection positioning not the absolute coordinates.



In my example, when changing the xstep/ystep measures the drawings remain in their positions and do not change with the xstep/ystep measures.



So I want to draw from intersection a to intersection b, not from position (1,1) to (2,2); and from intersection x to intersection z, not from position (3,3) to (4,3)



Can this be done without using an extra package, because I can not install new packages (on my workplace computer) for security reasons.



documentclass{beamer}
setbeamertemplate{navigation symbols}{}
usepackage{tikz}
usepackage{pgfplots}
begin{document}
begin{frame}[t]
frametitle{N}
begin{center}
begin{tikzpicture}
draw[step=.5cm,color=gray] (0,0) grid (8,8);
draw<2->[ultra thick, green, -latex] (1,1) -- (2,2);
draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (3,3) circle (.2cm) node (c){};
draw<3->[ultra thick, red, -latex] (c.center) -- (4,3);
node at (1,1){a};
node at (2,2){b};
node at (3,3){x};
node at (4,3){z};
end{tikzpicture}
end{center}
end{frame}
end{document}


enter image description here










share|improve this question














How can I give names to all intersection points of a grid, so that I can draw from a specific intersection to another. So when changing the xstep/ystep measures the drawing refers to the new intersection positioning not the absolute coordinates.



In my example, when changing the xstep/ystep measures the drawings remain in their positions and do not change with the xstep/ystep measures.



So I want to draw from intersection a to intersection b, not from position (1,1) to (2,2); and from intersection x to intersection z, not from position (3,3) to (4,3)



Can this be done without using an extra package, because I can not install new packages (on my workplace computer) for security reasons.



documentclass{beamer}
setbeamertemplate{navigation symbols}{}
usepackage{tikz}
usepackage{pgfplots}
begin{document}
begin{frame}[t]
frametitle{N}
begin{center}
begin{tikzpicture}
draw[step=.5cm,color=gray] (0,0) grid (8,8);
draw<2->[ultra thick, green, -latex] (1,1) -- (2,2);
draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (3,3) circle (.2cm) node (c){};
draw<3->[ultra thick, red, -latex] (c.center) -- (4,3);
node at (1,1){a};
node at (2,2){b};
node at (3,3){x};
node at (4,3){z};
end{tikzpicture}
end{center}
end{frame}
end{document}


enter image description here







tikz-pgf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 3 hours ago









HanyHany

1,100416




1,100416













  • @marmot Thank you for your comment, but I do not want to change the x/y scaling. This is an MWE not the whole drawing. There are other drawings in other intersections.

    – Hany
    2 hours ago





















  • @marmot Thank you for your comment, but I do not want to change the x/y scaling. This is an MWE not the whole drawing. There are other drawings in other intersections.

    – Hany
    2 hours ago



















@marmot Thank you for your comment, but I do not want to change the x/y scaling. This is an MWE not the whole drawing. There are other drawings in other intersections.

– Hany
2 hours ago







@marmot Thank you for your comment, but I do not want to change the x/y scaling. This is an MWE not the whole drawing. There are other drawings in other intersections.

– Hany
2 hours ago












2 Answers
2






active

oldest

votes


















2














If you remove the units from the steps and do, say, begin{tikzpicture}[x=2cm,y=2cm] this will increase the step of the grid while keeping the same intersections (or lattice nodes) connected.



documentclass{beamer}
setbeamertemplate{navigation symbols}{}
usepackage{tikz}
usepackage{pgfplots}
begin{document}
begin{frame}[t]
frametitle{N}
begin{center}
begin{tikzpicture}[x=2cm,y=2cm]
draw[step=.5,color=gray] (0,0) grid (5,4);
draw<2->[ultra thick, green, -latex] (1,1) -- (2,2);
draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (3,3) circle (.2cm) node (c){};
draw<3->[ultra thick, red, -latex] (c.center) -- (4,3);
node at (1,1){a};
node at (2,2){b};
node at (3,3){x};
node at (4,3){z};
end{tikzpicture}
end{center}
end{frame}
end{document}


enter image description here






share|improve this answer































    1














    I am not sure I understand your question. Would something like this work?



    documentclass{beamer}
    setbeamertemplate{navigation symbols}{}
    usepackage{tikz}
    usepackage{pgfplots}
    begin{document}
    begin{frame}[t]
    frametitle{N}
    begin{center}
    begin{tikzpicture}
    draw[step=.5cm,color=gray] (0,0) grid (8,8);
    % define coords
    coordinate(a) at (1,1);
    coordinate(b) at (2,2);
    coordinate(x) at (3,3);
    coordinate(z) at (4,3);
    % use them
    node at (a){a};
    node at (b){b};
    node at (x){x};
    node at (z){z};
    draw<2->[ultra thick, green, -latex] (a) -- (b);
    draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (x) circle (.2cm) node (c){};
    draw<3->[ultra thick, red, -latex] (c.center) -- (z);
    end{tikzpicture}
    end{center}
    end{frame}

    end{document}


    You can also just name the nodes, like



    node at (1,1)(a){a};


    But then you need to use draw (a.center) -- (b.center) if you want the same behavior (normally the arrows will stop at the node boundary, otherwise).






    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%2f470195%2fnaming-intersection-points-of-a-grid%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      If you remove the units from the steps and do, say, begin{tikzpicture}[x=2cm,y=2cm] this will increase the step of the grid while keeping the same intersections (or lattice nodes) connected.



      documentclass{beamer}
      setbeamertemplate{navigation symbols}{}
      usepackage{tikz}
      usepackage{pgfplots}
      begin{document}
      begin{frame}[t]
      frametitle{N}
      begin{center}
      begin{tikzpicture}[x=2cm,y=2cm]
      draw[step=.5,color=gray] (0,0) grid (5,4);
      draw<2->[ultra thick, green, -latex] (1,1) -- (2,2);
      draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (3,3) circle (.2cm) node (c){};
      draw<3->[ultra thick, red, -latex] (c.center) -- (4,3);
      node at (1,1){a};
      node at (2,2){b};
      node at (3,3){x};
      node at (4,3){z};
      end{tikzpicture}
      end{center}
      end{frame}
      end{document}


      enter image description here






      share|improve this answer




























        2














        If you remove the units from the steps and do, say, begin{tikzpicture}[x=2cm,y=2cm] this will increase the step of the grid while keeping the same intersections (or lattice nodes) connected.



        documentclass{beamer}
        setbeamertemplate{navigation symbols}{}
        usepackage{tikz}
        usepackage{pgfplots}
        begin{document}
        begin{frame}[t]
        frametitle{N}
        begin{center}
        begin{tikzpicture}[x=2cm,y=2cm]
        draw[step=.5,color=gray] (0,0) grid (5,4);
        draw<2->[ultra thick, green, -latex] (1,1) -- (2,2);
        draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (3,3) circle (.2cm) node (c){};
        draw<3->[ultra thick, red, -latex] (c.center) -- (4,3);
        node at (1,1){a};
        node at (2,2){b};
        node at (3,3){x};
        node at (4,3){z};
        end{tikzpicture}
        end{center}
        end{frame}
        end{document}


        enter image description here






        share|improve this answer


























          2












          2








          2







          If you remove the units from the steps and do, say, begin{tikzpicture}[x=2cm,y=2cm] this will increase the step of the grid while keeping the same intersections (or lattice nodes) connected.



          documentclass{beamer}
          setbeamertemplate{navigation symbols}{}
          usepackage{tikz}
          usepackage{pgfplots}
          begin{document}
          begin{frame}[t]
          frametitle{N}
          begin{center}
          begin{tikzpicture}[x=2cm,y=2cm]
          draw[step=.5,color=gray] (0,0) grid (5,4);
          draw<2->[ultra thick, green, -latex] (1,1) -- (2,2);
          draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (3,3) circle (.2cm) node (c){};
          draw<3->[ultra thick, red, -latex] (c.center) -- (4,3);
          node at (1,1){a};
          node at (2,2){b};
          node at (3,3){x};
          node at (4,3){z};
          end{tikzpicture}
          end{center}
          end{frame}
          end{document}


          enter image description here






          share|improve this answer













          If you remove the units from the steps and do, say, begin{tikzpicture}[x=2cm,y=2cm] this will increase the step of the grid while keeping the same intersections (or lattice nodes) connected.



          documentclass{beamer}
          setbeamertemplate{navigation symbols}{}
          usepackage{tikz}
          usepackage{pgfplots}
          begin{document}
          begin{frame}[t]
          frametitle{N}
          begin{center}
          begin{tikzpicture}[x=2cm,y=2cm]
          draw[step=.5,color=gray] (0,0) grid (5,4);
          draw<2->[ultra thick, green, -latex] (1,1) -- (2,2);
          draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (3,3) circle (.2cm) node (c){};
          draw<3->[ultra thick, red, -latex] (c.center) -- (4,3);
          node at (1,1){a};
          node at (2,2){b};
          node at (3,3){x};
          node at (4,3){z};
          end{tikzpicture}
          end{center}
          end{frame}
          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 hours ago









          marmotmarmot

          91.5k4106199




          91.5k4106199























              1














              I am not sure I understand your question. Would something like this work?



              documentclass{beamer}
              setbeamertemplate{navigation symbols}{}
              usepackage{tikz}
              usepackage{pgfplots}
              begin{document}
              begin{frame}[t]
              frametitle{N}
              begin{center}
              begin{tikzpicture}
              draw[step=.5cm,color=gray] (0,0) grid (8,8);
              % define coords
              coordinate(a) at (1,1);
              coordinate(b) at (2,2);
              coordinate(x) at (3,3);
              coordinate(z) at (4,3);
              % use them
              node at (a){a};
              node at (b){b};
              node at (x){x};
              node at (z){z};
              draw<2->[ultra thick, green, -latex] (a) -- (b);
              draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (x) circle (.2cm) node (c){};
              draw<3->[ultra thick, red, -latex] (c.center) -- (z);
              end{tikzpicture}
              end{center}
              end{frame}

              end{document}


              You can also just name the nodes, like



              node at (1,1)(a){a};


              But then you need to use draw (a.center) -- (b.center) if you want the same behavior (normally the arrows will stop at the node boundary, otherwise).






              share|improve this answer




























                1














                I am not sure I understand your question. Would something like this work?



                documentclass{beamer}
                setbeamertemplate{navigation symbols}{}
                usepackage{tikz}
                usepackage{pgfplots}
                begin{document}
                begin{frame}[t]
                frametitle{N}
                begin{center}
                begin{tikzpicture}
                draw[step=.5cm,color=gray] (0,0) grid (8,8);
                % define coords
                coordinate(a) at (1,1);
                coordinate(b) at (2,2);
                coordinate(x) at (3,3);
                coordinate(z) at (4,3);
                % use them
                node at (a){a};
                node at (b){b};
                node at (x){x};
                node at (z){z};
                draw<2->[ultra thick, green, -latex] (a) -- (b);
                draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (x) circle (.2cm) node (c){};
                draw<3->[ultra thick, red, -latex] (c.center) -- (z);
                end{tikzpicture}
                end{center}
                end{frame}

                end{document}


                You can also just name the nodes, like



                node at (1,1)(a){a};


                But then you need to use draw (a.center) -- (b.center) if you want the same behavior (normally the arrows will stop at the node boundary, otherwise).






                share|improve this answer


























                  1












                  1








                  1







                  I am not sure I understand your question. Would something like this work?



                  documentclass{beamer}
                  setbeamertemplate{navigation symbols}{}
                  usepackage{tikz}
                  usepackage{pgfplots}
                  begin{document}
                  begin{frame}[t]
                  frametitle{N}
                  begin{center}
                  begin{tikzpicture}
                  draw[step=.5cm,color=gray] (0,0) grid (8,8);
                  % define coords
                  coordinate(a) at (1,1);
                  coordinate(b) at (2,2);
                  coordinate(x) at (3,3);
                  coordinate(z) at (4,3);
                  % use them
                  node at (a){a};
                  node at (b){b};
                  node at (x){x};
                  node at (z){z};
                  draw<2->[ultra thick, green, -latex] (a) -- (b);
                  draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (x) circle (.2cm) node (c){};
                  draw<3->[ultra thick, red, -latex] (c.center) -- (z);
                  end{tikzpicture}
                  end{center}
                  end{frame}

                  end{document}


                  You can also just name the nodes, like



                  node at (1,1)(a){a};


                  But then you need to use draw (a.center) -- (b.center) if you want the same behavior (normally the arrows will stop at the node boundary, otherwise).






                  share|improve this answer













                  I am not sure I understand your question. Would something like this work?



                  documentclass{beamer}
                  setbeamertemplate{navigation symbols}{}
                  usepackage{tikz}
                  usepackage{pgfplots}
                  begin{document}
                  begin{frame}[t]
                  frametitle{N}
                  begin{center}
                  begin{tikzpicture}
                  draw[step=.5cm,color=gray] (0,0) grid (8,8);
                  % define coords
                  coordinate(a) at (1,1);
                  coordinate(b) at (2,2);
                  coordinate(x) at (3,3);
                  coordinate(z) at (4,3);
                  % use them
                  node at (a){a};
                  node at (b){b};
                  node at (x){x};
                  node at (z){z};
                  draw<2->[ultra thick, green, -latex] (a) -- (b);
                  draw[blue!40!black, thick, fill=blue!40!white, opacity=.5] (x) circle (.2cm) node (c){};
                  draw<3->[ultra thick, red, -latex] (c.center) -- (z);
                  end{tikzpicture}
                  end{center}
                  end{frame}

                  end{document}


                  You can also just name the nodes, like



                  node at (1,1)(a){a};


                  But then you need to use draw (a.center) -- (b.center) if you want the same behavior (normally the arrows will stop at the node boundary, otherwise).







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 25 mins ago









                  RmanoRmano

                  7,77721647




                  7,77721647






























                      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%2f470195%2fnaming-intersection-points-of-a-grid%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

                      What other Star Trek series did the main TNG cast show up in?

                      Berlina muro

                      Berlina aerponto