Replicating the precise positioning of labels for axes on a pgfplots diagramLaTeX equivalent of ConTeXt...

How to change two letters closest to a string and one letter immediately after a string using notepad++

Dice rolling probability game

If I can solve Sudoku can I solve Travelling Salesman Problem(TSP)? If yes, how?

What options are left, if Britain cannot decide?

Can I use USB data pins as power source

What should tie a collection of short-stories together?

How Could an Airship Be Repaired Mid-Flight

Official degrees of earth’s rotation per day

It's a yearly task, alright

Why doesn't using two cd commands in bash script execute the second command?

How to explain that I do not want to visit a country due to personal safety concern?

What has been your most complicated TikZ drawing?

Min function accepting varying number of arguments in C++17

Life insurance that covers only simultaneous/dual deaths

Could the Saturn V actually have launched astronauts around Venus?

Unexpected result from ArcLength

If curse and magic is two sides of the same coin, why the former is forbidden?

How could a scammer know the apps on my phone / iTunes account?

Is there a data structure that only stores hash codes and not the actual objects?

How to read the value of this capacitor?

Does someone need to be connected to my network to sniff HTTP requests?

What are substitutions for coconut in curry?

Does Mathematica reuse previous computations?

Identifying the interval from A♭ to D♯



Replicating the precise positioning of labels for axes on a pgfplots diagram


LaTeX equivalent of ConTeXt buffersTikz: precise callout positioningpgfplots pins in front of the axesTikZ scaling graphic and adjust node position and keep font sizeTikZ/ERD: node (=Entity) label on the insideresizing axes in pgfplotsAxes pointing in both directions and positioning axes labels (Tikz). AD-AS DiagramPlacing labels for axes appropriately using “anchor=north west” in pgfplotspgfplots: multiple loops for ticks, positioning, etcSet bounding box of pgfplots diagram relative to axes













0















I have the graphs of |x| + |y| = 6 and y = x - 2, and y = x + 2 on separate Cartesian planes. One is drawn with pgfplots and the other is drawn with only TikZ. I like the position of the labels for the axes using pgfplots. How do I get the same position of the labels for the axes - x and y - using only TikZ?



documentclass{amsart}
usepackage{amsmath}


usepackage{tikz}
usetikzlibrary{calc,intersections}



usepackage{pgfplots}
pgfplotsset{compat=1.11}


begin{document}


begin{tikzpicture}


begin{axis}[width=3in, height=3in, axis lines=middle, clip=false,
axis lines=middle, clip=false,
xmin=-12,xmax=12,
ymin=-12,ymax=12,
restrict y to domain=-12:12,
xtick={empty}, ytick={empty},
axis line style={latex-latex},
xlabel=textit{x},ylabel=textit{y},
axis line style={shorten >=-12.5pt, shorten <=-12.5pt},
xlabel style={at={(ticklabel* cs:1)}, xshift=12.5pt, anchor=north west},
ylabel style={at={(ticklabel* cs:1)}, yshift=12.5pt, anchor=south west}
]

addplot[samples=2, domain=0:6] {x - 6};
addplot[samples=2, domain=-6:0] {x + 6};
addplot[samples=2, domain=0:6] {-x + 6};
addplot[samples=2, domain=-6:0] {-x - 6};
addplot[samples=2, latex-latex, domain=-10:10] {x - 2};
addplot[samples=2, latex-latex, domain=-10:10] {x + 2};

%The intersections between the square |x| + |y| = 6 and two parallel lines are located.
coordinate (A) at (-4,-2);
coordinate (B) at (-2,-4);
coordinate (C) at (4,2);
coordinate (D) at (2,4);


coordinate (P_1) at (-3,3);
coordinate (P_2) at (0,6);

coordinate (Q_1) at (-9,-7);
coordinate (Q_2) at (0,2);
end{axis}


%A "pin" is drawn between the label for the graph of |x| + |y| = 6 and a point on the graph.
draw[draw=gray, shorten <=1mm, shorten >=1mm] (P_1) -- ($(P_1)!0.75cm!90:(P_2)$);
node[anchor=east, inner sep=0, font=footnotesize] at ($(P_1)!0.75cm!90:(P_2)$) {makebox[0pt][r]{$vert x vert + vert y vert = 6$}};

%A "pin" is drawn between the label for the graph of y = x + 2 and a point on the graph.
draw[draw=gray, shorten <=1mm, shorten >=1mm] (Q_1) -- ($(Q_1)!0.75cm!90:(Q_2)$);
node[anchor=east, inner sep=0, font=footnotesize] at ($(Q_1)!0.75cm!90:(Q_2)$) {makebox[0pt][r]{$y = x - 2$}};


end{tikzpicture}

begin{tikzpicture}

%On the Cartesian plane, the solution set to |x| + |y| leq 6 and $|x - y| geq 2$ is plotted.

draw[latex-latex] ($({(1/3)*(-10)}, 0) +(-12.5pt,0)$) -- ($({(1/3)*10}, 0) +(12.5pt,0)$);
draw[latex-latex] ($(0,{(1/3)*(-12)}) +(0,-12.5pt)$) -- ($(0,{(1/3)*12}) +(0,12.5pt)$);
node [anchor=north west] at ($({(1/3)*10}, 0) +(0.15,0) +(12.5pt,0)$){textit{x}};
node [anchor=south west] at ($(0,{(1/3)*12}) +(0,0.15) +(0,12.5pt)$){textit{y}};


draw (0,{(1/3)*(-6)}) -- ({(1/3)*6},0) -- (0,{(1/3)*6}) -- ({(1/3)*(-6)},0) -- cycle;

draw [latex-latex] ({(1/3)*(-10)}, {(1/3)*(-12)}) -- ({(1/3)*10}, {(1/3)*8});
draw [latex-latex] ({(1/3)*(-10)}, {(1/3)*(-8)}) -- ({(1/3)*10}, {(1/3)*12});


end{tikzpicture}


end{document}








share



























    0















    I have the graphs of |x| + |y| = 6 and y = x - 2, and y = x + 2 on separate Cartesian planes. One is drawn with pgfplots and the other is drawn with only TikZ. I like the position of the labels for the axes using pgfplots. How do I get the same position of the labels for the axes - x and y - using only TikZ?



    documentclass{amsart}
    usepackage{amsmath}


    usepackage{tikz}
    usetikzlibrary{calc,intersections}



    usepackage{pgfplots}
    pgfplotsset{compat=1.11}


    begin{document}


    begin{tikzpicture}


    begin{axis}[width=3in, height=3in, axis lines=middle, clip=false,
    axis lines=middle, clip=false,
    xmin=-12,xmax=12,
    ymin=-12,ymax=12,
    restrict y to domain=-12:12,
    xtick={empty}, ytick={empty},
    axis line style={latex-latex},
    xlabel=textit{x},ylabel=textit{y},
    axis line style={shorten >=-12.5pt, shorten <=-12.5pt},
    xlabel style={at={(ticklabel* cs:1)}, xshift=12.5pt, anchor=north west},
    ylabel style={at={(ticklabel* cs:1)}, yshift=12.5pt, anchor=south west}
    ]

    addplot[samples=2, domain=0:6] {x - 6};
    addplot[samples=2, domain=-6:0] {x + 6};
    addplot[samples=2, domain=0:6] {-x + 6};
    addplot[samples=2, domain=-6:0] {-x - 6};
    addplot[samples=2, latex-latex, domain=-10:10] {x - 2};
    addplot[samples=2, latex-latex, domain=-10:10] {x + 2};

    %The intersections between the square |x| + |y| = 6 and two parallel lines are located.
    coordinate (A) at (-4,-2);
    coordinate (B) at (-2,-4);
    coordinate (C) at (4,2);
    coordinate (D) at (2,4);


    coordinate (P_1) at (-3,3);
    coordinate (P_2) at (0,6);

    coordinate (Q_1) at (-9,-7);
    coordinate (Q_2) at (0,2);
    end{axis}


    %A "pin" is drawn between the label for the graph of |x| + |y| = 6 and a point on the graph.
    draw[draw=gray, shorten <=1mm, shorten >=1mm] (P_1) -- ($(P_1)!0.75cm!90:(P_2)$);
    node[anchor=east, inner sep=0, font=footnotesize] at ($(P_1)!0.75cm!90:(P_2)$) {makebox[0pt][r]{$vert x vert + vert y vert = 6$}};

    %A "pin" is drawn between the label for the graph of y = x + 2 and a point on the graph.
    draw[draw=gray, shorten <=1mm, shorten >=1mm] (Q_1) -- ($(Q_1)!0.75cm!90:(Q_2)$);
    node[anchor=east, inner sep=0, font=footnotesize] at ($(Q_1)!0.75cm!90:(Q_2)$) {makebox[0pt][r]{$y = x - 2$}};


    end{tikzpicture}

    begin{tikzpicture}

    %On the Cartesian plane, the solution set to |x| + |y| leq 6 and $|x - y| geq 2$ is plotted.

    draw[latex-latex] ($({(1/3)*(-10)}, 0) +(-12.5pt,0)$) -- ($({(1/3)*10}, 0) +(12.5pt,0)$);
    draw[latex-latex] ($(0,{(1/3)*(-12)}) +(0,-12.5pt)$) -- ($(0,{(1/3)*12}) +(0,12.5pt)$);
    node [anchor=north west] at ($({(1/3)*10}, 0) +(0.15,0) +(12.5pt,0)$){textit{x}};
    node [anchor=south west] at ($(0,{(1/3)*12}) +(0,0.15) +(0,12.5pt)$){textit{y}};


    draw (0,{(1/3)*(-6)}) -- ({(1/3)*6},0) -- (0,{(1/3)*6}) -- ({(1/3)*(-6)},0) -- cycle;

    draw [latex-latex] ({(1/3)*(-10)}, {(1/3)*(-12)}) -- ({(1/3)*10}, {(1/3)*8});
    draw [latex-latex] ({(1/3)*(-10)}, {(1/3)*(-8)}) -- ({(1/3)*10}, {(1/3)*12});


    end{tikzpicture}


    end{document}








    share

























      0












      0








      0








      I have the graphs of |x| + |y| = 6 and y = x - 2, and y = x + 2 on separate Cartesian planes. One is drawn with pgfplots and the other is drawn with only TikZ. I like the position of the labels for the axes using pgfplots. How do I get the same position of the labels for the axes - x and y - using only TikZ?



      documentclass{amsart}
      usepackage{amsmath}


      usepackage{tikz}
      usetikzlibrary{calc,intersections}



      usepackage{pgfplots}
      pgfplotsset{compat=1.11}


      begin{document}


      begin{tikzpicture}


      begin{axis}[width=3in, height=3in, axis lines=middle, clip=false,
      axis lines=middle, clip=false,
      xmin=-12,xmax=12,
      ymin=-12,ymax=12,
      restrict y to domain=-12:12,
      xtick={empty}, ytick={empty},
      axis line style={latex-latex},
      xlabel=textit{x},ylabel=textit{y},
      axis line style={shorten >=-12.5pt, shorten <=-12.5pt},
      xlabel style={at={(ticklabel* cs:1)}, xshift=12.5pt, anchor=north west},
      ylabel style={at={(ticklabel* cs:1)}, yshift=12.5pt, anchor=south west}
      ]

      addplot[samples=2, domain=0:6] {x - 6};
      addplot[samples=2, domain=-6:0] {x + 6};
      addplot[samples=2, domain=0:6] {-x + 6};
      addplot[samples=2, domain=-6:0] {-x - 6};
      addplot[samples=2, latex-latex, domain=-10:10] {x - 2};
      addplot[samples=2, latex-latex, domain=-10:10] {x + 2};

      %The intersections between the square |x| + |y| = 6 and two parallel lines are located.
      coordinate (A) at (-4,-2);
      coordinate (B) at (-2,-4);
      coordinate (C) at (4,2);
      coordinate (D) at (2,4);


      coordinate (P_1) at (-3,3);
      coordinate (P_2) at (0,6);

      coordinate (Q_1) at (-9,-7);
      coordinate (Q_2) at (0,2);
      end{axis}


      %A "pin" is drawn between the label for the graph of |x| + |y| = 6 and a point on the graph.
      draw[draw=gray, shorten <=1mm, shorten >=1mm] (P_1) -- ($(P_1)!0.75cm!90:(P_2)$);
      node[anchor=east, inner sep=0, font=footnotesize] at ($(P_1)!0.75cm!90:(P_2)$) {makebox[0pt][r]{$vert x vert + vert y vert = 6$}};

      %A "pin" is drawn between the label for the graph of y = x + 2 and a point on the graph.
      draw[draw=gray, shorten <=1mm, shorten >=1mm] (Q_1) -- ($(Q_1)!0.75cm!90:(Q_2)$);
      node[anchor=east, inner sep=0, font=footnotesize] at ($(Q_1)!0.75cm!90:(Q_2)$) {makebox[0pt][r]{$y = x - 2$}};


      end{tikzpicture}

      begin{tikzpicture}

      %On the Cartesian plane, the solution set to |x| + |y| leq 6 and $|x - y| geq 2$ is plotted.

      draw[latex-latex] ($({(1/3)*(-10)}, 0) +(-12.5pt,0)$) -- ($({(1/3)*10}, 0) +(12.5pt,0)$);
      draw[latex-latex] ($(0,{(1/3)*(-12)}) +(0,-12.5pt)$) -- ($(0,{(1/3)*12}) +(0,12.5pt)$);
      node [anchor=north west] at ($({(1/3)*10}, 0) +(0.15,0) +(12.5pt,0)$){textit{x}};
      node [anchor=south west] at ($(0,{(1/3)*12}) +(0,0.15) +(0,12.5pt)$){textit{y}};


      draw (0,{(1/3)*(-6)}) -- ({(1/3)*6},0) -- (0,{(1/3)*6}) -- ({(1/3)*(-6)},0) -- cycle;

      draw [latex-latex] ({(1/3)*(-10)}, {(1/3)*(-12)}) -- ({(1/3)*10}, {(1/3)*8});
      draw [latex-latex] ({(1/3)*(-10)}, {(1/3)*(-8)}) -- ({(1/3)*10}, {(1/3)*12});


      end{tikzpicture}


      end{document}








      share














      I have the graphs of |x| + |y| = 6 and y = x - 2, and y = x + 2 on separate Cartesian planes. One is drawn with pgfplots and the other is drawn with only TikZ. I like the position of the labels for the axes using pgfplots. How do I get the same position of the labels for the axes - x and y - using only TikZ?



      documentclass{amsart}
      usepackage{amsmath}


      usepackage{tikz}
      usetikzlibrary{calc,intersections}



      usepackage{pgfplots}
      pgfplotsset{compat=1.11}


      begin{document}


      begin{tikzpicture}


      begin{axis}[width=3in, height=3in, axis lines=middle, clip=false,
      axis lines=middle, clip=false,
      xmin=-12,xmax=12,
      ymin=-12,ymax=12,
      restrict y to domain=-12:12,
      xtick={empty}, ytick={empty},
      axis line style={latex-latex},
      xlabel=textit{x},ylabel=textit{y},
      axis line style={shorten >=-12.5pt, shorten <=-12.5pt},
      xlabel style={at={(ticklabel* cs:1)}, xshift=12.5pt, anchor=north west},
      ylabel style={at={(ticklabel* cs:1)}, yshift=12.5pt, anchor=south west}
      ]

      addplot[samples=2, domain=0:6] {x - 6};
      addplot[samples=2, domain=-6:0] {x + 6};
      addplot[samples=2, domain=0:6] {-x + 6};
      addplot[samples=2, domain=-6:0] {-x - 6};
      addplot[samples=2, latex-latex, domain=-10:10] {x - 2};
      addplot[samples=2, latex-latex, domain=-10:10] {x + 2};

      %The intersections between the square |x| + |y| = 6 and two parallel lines are located.
      coordinate (A) at (-4,-2);
      coordinate (B) at (-2,-4);
      coordinate (C) at (4,2);
      coordinate (D) at (2,4);


      coordinate (P_1) at (-3,3);
      coordinate (P_2) at (0,6);

      coordinate (Q_1) at (-9,-7);
      coordinate (Q_2) at (0,2);
      end{axis}


      %A "pin" is drawn between the label for the graph of |x| + |y| = 6 and a point on the graph.
      draw[draw=gray, shorten <=1mm, shorten >=1mm] (P_1) -- ($(P_1)!0.75cm!90:(P_2)$);
      node[anchor=east, inner sep=0, font=footnotesize] at ($(P_1)!0.75cm!90:(P_2)$) {makebox[0pt][r]{$vert x vert + vert y vert = 6$}};

      %A "pin" is drawn between the label for the graph of y = x + 2 and a point on the graph.
      draw[draw=gray, shorten <=1mm, shorten >=1mm] (Q_1) -- ($(Q_1)!0.75cm!90:(Q_2)$);
      node[anchor=east, inner sep=0, font=footnotesize] at ($(Q_1)!0.75cm!90:(Q_2)$) {makebox[0pt][r]{$y = x - 2$}};


      end{tikzpicture}

      begin{tikzpicture}

      %On the Cartesian plane, the solution set to |x| + |y| leq 6 and $|x - y| geq 2$ is plotted.

      draw[latex-latex] ($({(1/3)*(-10)}, 0) +(-12.5pt,0)$) -- ($({(1/3)*10}, 0) +(12.5pt,0)$);
      draw[latex-latex] ($(0,{(1/3)*(-12)}) +(0,-12.5pt)$) -- ($(0,{(1/3)*12}) +(0,12.5pt)$);
      node [anchor=north west] at ($({(1/3)*10}, 0) +(0.15,0) +(12.5pt,0)$){textit{x}};
      node [anchor=south west] at ($(0,{(1/3)*12}) +(0,0.15) +(0,12.5pt)$){textit{y}};


      draw (0,{(1/3)*(-6)}) -- ({(1/3)*6},0) -- (0,{(1/3)*6}) -- ({(1/3)*(-6)},0) -- cycle;

      draw [latex-latex] ({(1/3)*(-10)}, {(1/3)*(-12)}) -- ({(1/3)*10}, {(1/3)*8});
      draw [latex-latex] ({(1/3)*(-10)}, {(1/3)*(-8)}) -- ({(1/3)*10}, {(1/3)*12});


      end{tikzpicture}


      end{document}






      tikz-pgf





      share












      share










      share



      share










      asked 4 mins ago









      A gal named DesireA gal named Desire

      6411411




      6411411






















          0






          active

          oldest

          votes











          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%2f479740%2freplicating-the-precise-positioning-of-labels-for-axes-on-a-pgfplots-diagram%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f479740%2freplicating-the-precise-positioning-of-labels-for-axes-on-a-pgfplots-diagram%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

          El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

          Castillo d'Acher Características Menú de navegación

          Connecting two nodes from the same mother node horizontallyTikZ: What EXACTLY does the the |- notation for...