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

Do these spellcasting foci from Xanathar's Guide to Everything have to be held in a hand?

Did Ender ever learn that he killed Stilson and/or Bonzo?

Why doesn't the EU now just force the UK to choose between referendum and no-deal?

Is it normal that my co-workers at a fitness company criticize my food choices?

Co-worker team leader wants to inject his friend's awful software into our development. What should I say to our common boss?

Dice rolling probability game

What's the meaning of “spike” in the context of “adrenaline spike”?

how to write formula in word in latex

Why do Australian milk farmers need to protest supermarkets' milk price?

How to create the Curved texte?

A sequence that has integer values for prime indexes only:

Recruiter wants very extensive technical details about all of my previous work

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

Interplanetary conflict, some disease destroys the ability to understand or appreciate music

How to make healing in an exploration game interesting

Do I need life insurance if I can cover my own funeral costs?

Existence of subset with given Hausdorff dimension

A link redirect to http instead of https: how critical is it?

Why do passenger jet manufacturers design their planes with stall prevention systems?

Why did it take so long to abandon sail after steamships were demonstrated?

How to write cleanly even if my character uses expletive language?

What did Alexander Pope mean by "Expletives their feeble Aid do join"?

A Cautionary Suggestion

Instead of Universal Basic Income, why not Universal Basic NEEDS?



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 2 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

          Paper upload error, “Upload failed: The top margin is 0.715 in on page 3, which is below the required...

          Emraan Hashmi Filmografia | Linki zewnętrzne | Menu nawigacyjneGulshan GroverGulshan...

          How can I write this formula?newline and italics added with leqWhy does widehat behave differently if I...