xticklabel distance for math expression












1















I have a pgfplot and the labels in the x axis are not centered as I expected and this is because one of them is higher than the other because of the superscript.



documentclass{article}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

usepackage{pgfplots}

begin{document}

begin{tikzpicture}
begin{axis}[
ytick={empty},
ytick={},
xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
xtick={0,4},
yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
ytick={-2,2},
domain=-2:6,
samples=55,
scaled ticks=false,
ymax=10,
ymin=-5,
xtick distance={60},
]
%addplot+[no marks,thick] {-5*(x-1)*(x)*(x-2)};
addplot[smooth,thick]
coordinates{
(-1.9,9.9) (-1,0) (0,-2)
(1,0)(3,4)(4,2)
(5,4)(6,10)
};
draw[dashed] (axis cs:0,-5) -- (axis cs:0,-2);
draw[dashed] (axis cs:4,-5) -- (axis cs:4,2);
draw[dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
draw[dashed] (axis cs:-3,2) -- (axis cs:4,2);
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
end{axis}
end{tikzpicture}

end{document}


enter image description here



And a zoom of the axis:



enter image description here



How can I do to center the letter u to the same distance ?










share|improve this question























  • Just add xticklabel style={text height=2ex},.

    – marmot
    Mar 17 at 10:50











  • It has not worked :( I tried also with 20ex and I see no difference.

    – GG1991
    Mar 17 at 10:55
















1















I have a pgfplot and the labels in the x axis are not centered as I expected and this is because one of them is higher than the other because of the superscript.



documentclass{article}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

usepackage{pgfplots}

begin{document}

begin{tikzpicture}
begin{axis}[
ytick={empty},
ytick={},
xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
xtick={0,4},
yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
ytick={-2,2},
domain=-2:6,
samples=55,
scaled ticks=false,
ymax=10,
ymin=-5,
xtick distance={60},
]
%addplot+[no marks,thick] {-5*(x-1)*(x)*(x-2)};
addplot[smooth,thick]
coordinates{
(-1.9,9.9) (-1,0) (0,-2)
(1,0)(3,4)(4,2)
(5,4)(6,10)
};
draw[dashed] (axis cs:0,-5) -- (axis cs:0,-2);
draw[dashed] (axis cs:4,-5) -- (axis cs:4,2);
draw[dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
draw[dashed] (axis cs:-3,2) -- (axis cs:4,2);
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
end{axis}
end{tikzpicture}

end{document}


enter image description here



And a zoom of the axis:



enter image description here



How can I do to center the letter u to the same distance ?










share|improve this question























  • Just add xticklabel style={text height=2ex},.

    – marmot
    Mar 17 at 10:50











  • It has not worked :( I tried also with 20ex and I see no difference.

    – GG1991
    Mar 17 at 10:55














1












1








1








I have a pgfplot and the labels in the x axis are not centered as I expected and this is because one of them is higher than the other because of the superscript.



documentclass{article}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

usepackage{pgfplots}

begin{document}

begin{tikzpicture}
begin{axis}[
ytick={empty},
ytick={},
xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
xtick={0,4},
yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
ytick={-2,2},
domain=-2:6,
samples=55,
scaled ticks=false,
ymax=10,
ymin=-5,
xtick distance={60},
]
%addplot+[no marks,thick] {-5*(x-1)*(x)*(x-2)};
addplot[smooth,thick]
coordinates{
(-1.9,9.9) (-1,0) (0,-2)
(1,0)(3,4)(4,2)
(5,4)(6,10)
};
draw[dashed] (axis cs:0,-5) -- (axis cs:0,-2);
draw[dashed] (axis cs:4,-5) -- (axis cs:4,2);
draw[dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
draw[dashed] (axis cs:-3,2) -- (axis cs:4,2);
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
end{axis}
end{tikzpicture}

end{document}


enter image description here



And a zoom of the axis:



enter image description here



How can I do to center the letter u to the same distance ?










share|improve this question














I have a pgfplot and the labels in the x axis are not centered as I expected and this is because one of them is higher than the other because of the superscript.



documentclass{article}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

usepackage{pgfplots}

begin{document}

begin{tikzpicture}
begin{axis}[
ytick={empty},
ytick={},
xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
xtick={0,4},
yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
ytick={-2,2},
domain=-2:6,
samples=55,
scaled ticks=false,
ymax=10,
ymin=-5,
xtick distance={60},
]
%addplot+[no marks,thick] {-5*(x-1)*(x)*(x-2)};
addplot[smooth,thick]
coordinates{
(-1.9,9.9) (-1,0) (0,-2)
(1,0)(3,4)(4,2)
(5,4)(6,10)
};
draw[dashed] (axis cs:0,-5) -- (axis cs:0,-2);
draw[dashed] (axis cs:4,-5) -- (axis cs:4,2);
draw[dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
draw[dashed] (axis cs:-3,2) -- (axis cs:4,2);
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
end{axis}
end{tikzpicture}

end{document}


enter image description here



And a zoom of the axis:



enter image description here



How can I do to center the letter u to the same distance ?







pgfplots ticks






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 17 at 10:46









GG1991GG1991

104




104













  • Just add xticklabel style={text height=2ex},.

    – marmot
    Mar 17 at 10:50











  • It has not worked :( I tried also with 20ex and I see no difference.

    – GG1991
    Mar 17 at 10:55



















  • Just add xticklabel style={text height=2ex},.

    – marmot
    Mar 17 at 10:50











  • It has not worked :( I tried also with 20ex and I see no difference.

    – GG1991
    Mar 17 at 10:55

















Just add xticklabel style={text height=2ex},.

– marmot
Mar 17 at 10:50





Just add xticklabel style={text height=2ex},.

– marmot
Mar 17 at 10:50













It has not worked :( I tried also with 20ex and I see no difference.

– GG1991
Mar 17 at 10:55





It has not worked :( I tried also with 20ex and I see no difference.

– GG1991
Mar 17 at 10:55










2 Answers
2






active

oldest

votes


















1














On my machine adding xticklabel style={text height=2ex} works.



documentclass{article}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

usepackage{pgfplots}

begin{document}

begin{tikzpicture}
begin{axis}[
ytick={empty},
ytick={},
xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
xtick={0,4},
yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
xticklabel style={text height=2ex},
ytick={-2,2},
domain=-2:6,
samples=55,
scaled ticks=false,
ymax=10,
ymin=-5,
xtick distance={60},
]
%addplot+[no marks,thick] {-5*(x-1)*(x)*(x-2)};
addplot[smooth,thick]
coordinates{
(-1.9,9.9) (-1,0) (0,-2)
(1,0)(3,4)(4,2)
(5,4)(6,10)
};
draw[dashed] (axis cs:0,-5) -- (axis cs:0,-2);
draw[dashed] (axis cs:4,-5) -- (axis cs:4,2);
draw[dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
draw[dashed] (axis cs:-3,2) -- (axis cs:4,2);
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
node[circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
end{axis}
end{tikzpicture}

end{document}


enter image description here






share|improve this answer



















  • 1





    yes, sorry I was doing something wrong, now it works :)

    – GG1991
    Mar 17 at 11:11



















0














To overcome this there exists the option typeset ticklabels with strut. Simply add it to the axis options and you receive the expected result.



% used PGFPlots v1.16
documentclass[border=5pt]{standalone}
usepackage{pgfplots}
begin{document}
begin{tikzpicture}
begin{axis}[
xtick={0,4},
xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
ymin=-5,
ymax=10,
ytick={-2,2},
yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
typeset ticklabels with strut, % <-- added
]
addplot [smooth,thick] coordinates {
(-1.9,9.9) (-1,0) (0,-2)
(1,0)(3,4)(4,2)
(5,4)(6,10)
};
draw [dashed] (axis cs:0,-5) -- (axis cs:0,-2);
draw [dashed] (axis cs:4,-5) -- (axis cs:4,2);
draw [dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
draw [dashed] (axis cs:-3,2) -- (axis cs:4,2);
node [circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
node [circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
end{axis}
end{tikzpicture}
end{document}


image showing the result of above code






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%2f479906%2fxticklabel-distance-for-math-expression%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









    1














    On my machine adding xticklabel style={text height=2ex} works.



    documentclass{article}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

    usepackage{pgfplots}

    begin{document}

    begin{tikzpicture}
    begin{axis}[
    ytick={empty},
    ytick={},
    xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
    xtick={0,4},
    yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
    xticklabel style={text height=2ex},
    ytick={-2,2},
    domain=-2:6,
    samples=55,
    scaled ticks=false,
    ymax=10,
    ymin=-5,
    xtick distance={60},
    ]
    %addplot+[no marks,thick] {-5*(x-1)*(x)*(x-2)};
    addplot[smooth,thick]
    coordinates{
    (-1.9,9.9) (-1,0) (0,-2)
    (1,0)(3,4)(4,2)
    (5,4)(6,10)
    };
    draw[dashed] (axis cs:0,-5) -- (axis cs:0,-2);
    draw[dashed] (axis cs:4,-5) -- (axis cs:4,2);
    draw[dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
    draw[dashed] (axis cs:-3,2) -- (axis cs:4,2);
    node[circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
    node[circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
    end{axis}
    end{tikzpicture}

    end{document}


    enter image description here






    share|improve this answer



















    • 1





      yes, sorry I was doing something wrong, now it works :)

      – GG1991
      Mar 17 at 11:11
















    1














    On my machine adding xticklabel style={text height=2ex} works.



    documentclass{article}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

    usepackage{pgfplots}

    begin{document}

    begin{tikzpicture}
    begin{axis}[
    ytick={empty},
    ytick={},
    xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
    xtick={0,4},
    yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
    xticklabel style={text height=2ex},
    ytick={-2,2},
    domain=-2:6,
    samples=55,
    scaled ticks=false,
    ymax=10,
    ymin=-5,
    xtick distance={60},
    ]
    %addplot+[no marks,thick] {-5*(x-1)*(x)*(x-2)};
    addplot[smooth,thick]
    coordinates{
    (-1.9,9.9) (-1,0) (0,-2)
    (1,0)(3,4)(4,2)
    (5,4)(6,10)
    };
    draw[dashed] (axis cs:0,-5) -- (axis cs:0,-2);
    draw[dashed] (axis cs:4,-5) -- (axis cs:4,2);
    draw[dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
    draw[dashed] (axis cs:-3,2) -- (axis cs:4,2);
    node[circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
    node[circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
    end{axis}
    end{tikzpicture}

    end{document}


    enter image description here






    share|improve this answer



















    • 1





      yes, sorry I was doing something wrong, now it works :)

      – GG1991
      Mar 17 at 11:11














    1












    1








    1







    On my machine adding xticklabel style={text height=2ex} works.



    documentclass{article}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

    usepackage{pgfplots}

    begin{document}

    begin{tikzpicture}
    begin{axis}[
    ytick={empty},
    ytick={},
    xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
    xtick={0,4},
    yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
    xticklabel style={text height=2ex},
    ytick={-2,2},
    domain=-2:6,
    samples=55,
    scaled ticks=false,
    ymax=10,
    ymin=-5,
    xtick distance={60},
    ]
    %addplot+[no marks,thick] {-5*(x-1)*(x)*(x-2)};
    addplot[smooth,thick]
    coordinates{
    (-1.9,9.9) (-1,0) (0,-2)
    (1,0)(3,4)(4,2)
    (5,4)(6,10)
    };
    draw[dashed] (axis cs:0,-5) -- (axis cs:0,-2);
    draw[dashed] (axis cs:4,-5) -- (axis cs:4,2);
    draw[dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
    draw[dashed] (axis cs:-3,2) -- (axis cs:4,2);
    node[circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
    node[circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
    end{axis}
    end{tikzpicture}

    end{document}


    enter image description here






    share|improve this answer













    On my machine adding xticklabel style={text height=2ex} works.



    documentclass{article}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn

    usepackage{pgfplots}

    begin{document}

    begin{tikzpicture}
    begin{axis}[
    ytick={empty},
    ytick={},
    xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
    xtick={0,4},
    yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
    xticklabel style={text height=2ex},
    ytick={-2,2},
    domain=-2:6,
    samples=55,
    scaled ticks=false,
    ymax=10,
    ymin=-5,
    xtick distance={60},
    ]
    %addplot+[no marks,thick] {-5*(x-1)*(x)*(x-2)};
    addplot[smooth,thick]
    coordinates{
    (-1.9,9.9) (-1,0) (0,-2)
    (1,0)(3,4)(4,2)
    (5,4)(6,10)
    };
    draw[dashed] (axis cs:0,-5) -- (axis cs:0,-2);
    draw[dashed] (axis cs:4,-5) -- (axis cs:4,2);
    draw[dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
    draw[dashed] (axis cs:-3,2) -- (axis cs:4,2);
    node[circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
    node[circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
    end{axis}
    end{tikzpicture}

    end{document}


    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 17 at 10:57









    marmotmarmot

    112k5141267




    112k5141267








    • 1





      yes, sorry I was doing something wrong, now it works :)

      – GG1991
      Mar 17 at 11:11














    • 1





      yes, sorry I was doing something wrong, now it works :)

      – GG1991
      Mar 17 at 11:11








    1




    1





    yes, sorry I was doing something wrong, now it works :)

    – GG1991
    Mar 17 at 11:11





    yes, sorry I was doing something wrong, now it works :)

    – GG1991
    Mar 17 at 11:11











    0














    To overcome this there exists the option typeset ticklabels with strut. Simply add it to the axis options and you receive the expected result.



    % used PGFPlots v1.16
    documentclass[border=5pt]{standalone}
    usepackage{pgfplots}
    begin{document}
    begin{tikzpicture}
    begin{axis}[
    xtick={0,4},
    xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
    ymin=-5,
    ymax=10,
    ytick={-2,2},
    yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
    typeset ticklabels with strut, % <-- added
    ]
    addplot [smooth,thick] coordinates {
    (-1.9,9.9) (-1,0) (0,-2)
    (1,0)(3,4)(4,2)
    (5,4)(6,10)
    };
    draw [dashed] (axis cs:0,-5) -- (axis cs:0,-2);
    draw [dashed] (axis cs:4,-5) -- (axis cs:4,2);
    draw [dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
    draw [dashed] (axis cs:-3,2) -- (axis cs:4,2);
    node [circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
    node [circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
    end{axis}
    end{tikzpicture}
    end{document}


    image showing the result of above code






    share|improve this answer




























      0














      To overcome this there exists the option typeset ticklabels with strut. Simply add it to the axis options and you receive the expected result.



      % used PGFPlots v1.16
      documentclass[border=5pt]{standalone}
      usepackage{pgfplots}
      begin{document}
      begin{tikzpicture}
      begin{axis}[
      xtick={0,4},
      xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
      ymin=-5,
      ymax=10,
      ytick={-2,2},
      yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
      typeset ticklabels with strut, % <-- added
      ]
      addplot [smooth,thick] coordinates {
      (-1.9,9.9) (-1,0) (0,-2)
      (1,0)(3,4)(4,2)
      (5,4)(6,10)
      };
      draw [dashed] (axis cs:0,-5) -- (axis cs:0,-2);
      draw [dashed] (axis cs:4,-5) -- (axis cs:4,2);
      draw [dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
      draw [dashed] (axis cs:-3,2) -- (axis cs:4,2);
      node [circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
      node [circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
      end{axis}
      end{tikzpicture}
      end{document}


      image showing the result of above code






      share|improve this answer


























        0












        0








        0







        To overcome this there exists the option typeset ticklabels with strut. Simply add it to the axis options and you receive the expected result.



        % used PGFPlots v1.16
        documentclass[border=5pt]{standalone}
        usepackage{pgfplots}
        begin{document}
        begin{tikzpicture}
        begin{axis}[
        xtick={0,4},
        xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
        ymin=-5,
        ymax=10,
        ytick={-2,2},
        yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
        typeset ticklabels with strut, % <-- added
        ]
        addplot [smooth,thick] coordinates {
        (-1.9,9.9) (-1,0) (0,-2)
        (1,0)(3,4)(4,2)
        (5,4)(6,10)
        };
        draw [dashed] (axis cs:0,-5) -- (axis cs:0,-2);
        draw [dashed] (axis cs:4,-5) -- (axis cs:4,2);
        draw [dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
        draw [dashed] (axis cs:-3,2) -- (axis cs:4,2);
        node [circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
        node [circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
        end{axis}
        end{tikzpicture}
        end{document}


        image showing the result of above code






        share|improve this answer













        To overcome this there exists the option typeset ticklabels with strut. Simply add it to the axis options and you receive the expected result.



        % used PGFPlots v1.16
        documentclass[border=5pt]{standalone}
        usepackage{pgfplots}
        begin{document}
        begin{tikzpicture}
        begin{axis}[
        xtick={0,4},
        xticklabels={$u_{n+1}^{}$,$u_{n+1}^{0}$},
        ymin=-5,
        ymax=10,
        ytick={-2,2},
        yticklabels={$r(u_{n+1}^{}) = 0$,$r(u_{n+1}^{0})>0$},
        typeset ticklabels with strut, % <-- added
        ]
        addplot [smooth,thick] coordinates {
        (-1.9,9.9) (-1,0) (0,-2)
        (1,0)(3,4)(4,2)
        (5,4)(6,10)
        };
        draw [dashed] (axis cs:0,-5) -- (axis cs:0,-2);
        draw [dashed] (axis cs:4,-5) -- (axis cs:4,2);
        draw [dashed] (axis cs:-3,-2) -- (axis cs:0,-2);
        draw [dashed] (axis cs:-3,2) -- (axis cs:4,2);
        node [circle,draw=black,fill=black,scale=0.8] at (axis cs:0,-2) {};
        node [circle,draw=black,fill=black,scale=0.8] at (axis cs:4,2) {};
        end{axis}
        end{tikzpicture}
        end{document}


        image showing the result of above code







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 17 at 20:54









        Stefan PinnowStefan Pinnow

        20.3k83477




        20.3k83477






























            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%2f479906%2fxticklabel-distance-for-math-expression%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

            How to send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?