How do I plot an ellipse with addplot with using an equation











up vote
1
down vote

favorite












i am trying to plot an ellipse in my coordinate system. TikZ provides an implemented easy method for plotting ellipses, but I don't like it — I want to draw my ellipses with actual analytic equations.



When I tried addplot[line width=0.7pt, red, samples=2000]{(x^2)/9 + (y^2)/3 == 1};, I got this error message:



! Package pgfplots Error: Sorry, you can't use 'y' in this context. PGFPlots expected to sample a line, not a mesh. Please use the [mesh] option combined with [samples y>0] and [domain y!=0:0] to indicate a twodimensional input domain.


I took the advice and added [mesh], [scale y>0] and [y!=0:0] to my addplot preamble. Well, it didn't go well, as it produced this error:



! Package pgfplots Error: Sorry, the supplied plot command is unknown or unsupported by pgfplots! Ignoring it..


Well, looks like pgfplots doesn't like and y's in equations. Fine, I'll just express the y and proceed from there. From this process, I got addplot[line width=0.7pt, red, samples=2000]{-sqrt(9 - x^2)/sqrt(3)};, which did render, but only the lower part of the ellipse. This is to be expected, as the program is only taking either negative or positive part of the square root argument when drawing the first addplot. The solution is to simply add a - to the equation (or in this case, remove it, sice the original equation already had a -) in the next addplot to force the program to finally (kind of) render the complete ellipse, which brings me to my MWE:



documentclass{standalone}

usepackage{pgfplots}
usepackage{tikz}

usetikzlibrary{calc}

begin{document}

begin{tikzpicture}
begin{axis}[
xmin=-5, xmax=5,
grid=both,
axis lines=middle,
minor tick num=9,
axis line style={latex-latex},
ticklabel style={font=tiny},
axis equal
]

addplot[line width=0.7pt, red, samples=2000]{-sqrt(9 - x^2)/sqrt(3)};
addplot[line width=0.7pt, red, samples=2000]{sqrt(9 - x^2)/sqrt(3)};

end{axis}
end{tikzpicture}

end{document}


Which produces:



enter image description here



I am displeased with my result because:




  1. of the need for graphing two graphs for a single ellipse,

  2. of the fact that the graph doesn't render near antipodal points (of origin),

  3. of the fact that I have to set a very large samples value to get even an arguably decent result (if I don't, the gap between antipodal points will be even bigger).


Please, help me plot an ellipse with addplot by means of a single equation. Thank you in advance.










share|improve this question






















  • Another option is tex.stackexchange.com/questions/18359/…
    – Torbjørn T.
    2 days ago















up vote
1
down vote

favorite












i am trying to plot an ellipse in my coordinate system. TikZ provides an implemented easy method for plotting ellipses, but I don't like it — I want to draw my ellipses with actual analytic equations.



When I tried addplot[line width=0.7pt, red, samples=2000]{(x^2)/9 + (y^2)/3 == 1};, I got this error message:



! Package pgfplots Error: Sorry, you can't use 'y' in this context. PGFPlots expected to sample a line, not a mesh. Please use the [mesh] option combined with [samples y>0] and [domain y!=0:0] to indicate a twodimensional input domain.


I took the advice and added [mesh], [scale y>0] and [y!=0:0] to my addplot preamble. Well, it didn't go well, as it produced this error:



! Package pgfplots Error: Sorry, the supplied plot command is unknown or unsupported by pgfplots! Ignoring it..


Well, looks like pgfplots doesn't like and y's in equations. Fine, I'll just express the y and proceed from there. From this process, I got addplot[line width=0.7pt, red, samples=2000]{-sqrt(9 - x^2)/sqrt(3)};, which did render, but only the lower part of the ellipse. This is to be expected, as the program is only taking either negative or positive part of the square root argument when drawing the first addplot. The solution is to simply add a - to the equation (or in this case, remove it, sice the original equation already had a -) in the next addplot to force the program to finally (kind of) render the complete ellipse, which brings me to my MWE:



documentclass{standalone}

usepackage{pgfplots}
usepackage{tikz}

usetikzlibrary{calc}

begin{document}

begin{tikzpicture}
begin{axis}[
xmin=-5, xmax=5,
grid=both,
axis lines=middle,
minor tick num=9,
axis line style={latex-latex},
ticklabel style={font=tiny},
axis equal
]

addplot[line width=0.7pt, red, samples=2000]{-sqrt(9 - x^2)/sqrt(3)};
addplot[line width=0.7pt, red, samples=2000]{sqrt(9 - x^2)/sqrt(3)};

end{axis}
end{tikzpicture}

end{document}


Which produces:



enter image description here



I am displeased with my result because:




  1. of the need for graphing two graphs for a single ellipse,

  2. of the fact that the graph doesn't render near antipodal points (of origin),

  3. of the fact that I have to set a very large samples value to get even an arguably decent result (if I don't, the gap between antipodal points will be even bigger).


Please, help me plot an ellipse with addplot by means of a single equation. Thank you in advance.










share|improve this question






















  • Another option is tex.stackexchange.com/questions/18359/…
    – Torbjørn T.
    2 days ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











i am trying to plot an ellipse in my coordinate system. TikZ provides an implemented easy method for plotting ellipses, but I don't like it — I want to draw my ellipses with actual analytic equations.



When I tried addplot[line width=0.7pt, red, samples=2000]{(x^2)/9 + (y^2)/3 == 1};, I got this error message:



! Package pgfplots Error: Sorry, you can't use 'y' in this context. PGFPlots expected to sample a line, not a mesh. Please use the [mesh] option combined with [samples y>0] and [domain y!=0:0] to indicate a twodimensional input domain.


I took the advice and added [mesh], [scale y>0] and [y!=0:0] to my addplot preamble. Well, it didn't go well, as it produced this error:



! Package pgfplots Error: Sorry, the supplied plot command is unknown or unsupported by pgfplots! Ignoring it..


Well, looks like pgfplots doesn't like and y's in equations. Fine, I'll just express the y and proceed from there. From this process, I got addplot[line width=0.7pt, red, samples=2000]{-sqrt(9 - x^2)/sqrt(3)};, which did render, but only the lower part of the ellipse. This is to be expected, as the program is only taking either negative or positive part of the square root argument when drawing the first addplot. The solution is to simply add a - to the equation (or in this case, remove it, sice the original equation already had a -) in the next addplot to force the program to finally (kind of) render the complete ellipse, which brings me to my MWE:



documentclass{standalone}

usepackage{pgfplots}
usepackage{tikz}

usetikzlibrary{calc}

begin{document}

begin{tikzpicture}
begin{axis}[
xmin=-5, xmax=5,
grid=both,
axis lines=middle,
minor tick num=9,
axis line style={latex-latex},
ticklabel style={font=tiny},
axis equal
]

addplot[line width=0.7pt, red, samples=2000]{-sqrt(9 - x^2)/sqrt(3)};
addplot[line width=0.7pt, red, samples=2000]{sqrt(9 - x^2)/sqrt(3)};

end{axis}
end{tikzpicture}

end{document}


Which produces:



enter image description here



I am displeased with my result because:




  1. of the need for graphing two graphs for a single ellipse,

  2. of the fact that the graph doesn't render near antipodal points (of origin),

  3. of the fact that I have to set a very large samples value to get even an arguably decent result (if I don't, the gap between antipodal points will be even bigger).


Please, help me plot an ellipse with addplot by means of a single equation. Thank you in advance.










share|improve this question













i am trying to plot an ellipse in my coordinate system. TikZ provides an implemented easy method for plotting ellipses, but I don't like it — I want to draw my ellipses with actual analytic equations.



When I tried addplot[line width=0.7pt, red, samples=2000]{(x^2)/9 + (y^2)/3 == 1};, I got this error message:



! Package pgfplots Error: Sorry, you can't use 'y' in this context. PGFPlots expected to sample a line, not a mesh. Please use the [mesh] option combined with [samples y>0] and [domain y!=0:0] to indicate a twodimensional input domain.


I took the advice and added [mesh], [scale y>0] and [y!=0:0] to my addplot preamble. Well, it didn't go well, as it produced this error:



! Package pgfplots Error: Sorry, the supplied plot command is unknown or unsupported by pgfplots! Ignoring it..


Well, looks like pgfplots doesn't like and y's in equations. Fine, I'll just express the y and proceed from there. From this process, I got addplot[line width=0.7pt, red, samples=2000]{-sqrt(9 - x^2)/sqrt(3)};, which did render, but only the lower part of the ellipse. This is to be expected, as the program is only taking either negative or positive part of the square root argument when drawing the first addplot. The solution is to simply add a - to the equation (or in this case, remove it, sice the original equation already had a -) in the next addplot to force the program to finally (kind of) render the complete ellipse, which brings me to my MWE:



documentclass{standalone}

usepackage{pgfplots}
usepackage{tikz}

usetikzlibrary{calc}

begin{document}

begin{tikzpicture}
begin{axis}[
xmin=-5, xmax=5,
grid=both,
axis lines=middle,
minor tick num=9,
axis line style={latex-latex},
ticklabel style={font=tiny},
axis equal
]

addplot[line width=0.7pt, red, samples=2000]{-sqrt(9 - x^2)/sqrt(3)};
addplot[line width=0.7pt, red, samples=2000]{sqrt(9 - x^2)/sqrt(3)};

end{axis}
end{tikzpicture}

end{document}


Which produces:



enter image description here



I am displeased with my result because:




  1. of the need for graphing two graphs for a single ellipse,

  2. of the fact that the graph doesn't render near antipodal points (of origin),

  3. of the fact that I have to set a very large samples value to get even an arguably decent result (if I don't, the gap between antipodal points will be even bigger).


Please, help me plot an ellipse with addplot by means of a single equation. Thank you in advance.







tikz-pgf pgfplots graphs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









Gregor Perčič

976211




976211












  • Another option is tex.stackexchange.com/questions/18359/…
    – Torbjørn T.
    2 days ago


















  • Another option is tex.stackexchange.com/questions/18359/…
    – Torbjørn T.
    2 days ago
















Another option is tex.stackexchange.com/questions/18359/…
– Torbjørn T.
2 days ago




Another option is tex.stackexchange.com/questions/18359/…
– Torbjørn T.
2 days ago










2 Answers
2






active

oldest

votes

















up vote
2
down vote



accepted










Can use polar coordinates to plot an ellipse. For equation, read polar form of ellipse.



enter image description here



This is just a minimum working example. Parameter values has to be adjusted to match exact requirement.



documentclass[border=3mm]{standalone}
usepackage{pgfplots}
%usepackage{tikz}
%usetikzlibrary{calc}

begin{document}
begin{tikzpicture}
begin{axis}[
xmin=-5, xmax=5,
grid=both,
axis lines=middle,
minor tick num=9,
axis line style={latex-latex},
ticklabel style={font=tiny},
axis equal
]

addplot[domain=0:360,data cs=polar, samples=200,
line width=0.7pt, red] (x,{1/(sqrt(0.3-0.2*cos(x)*cos(x)))});
end{axis}
end{tikzpicture}
end{document}





share|improve this answer






























    up vote
    4
    down vote













    These plotting programs are typically for plotting functions, which an ellipse isn't. Besides breaking the relation into two functions, as you've done, it's also possible (and in fact works better to avoid needing so many sample points) to define the ellipse as parametric equations; see the section on converting ellipses. You have to know that deg(x) is needed for syntax to get radians and the domain has to cover a range of 2pi; I've got it going from -pi to pi but 0 to 2pi also works. To make sure less points are needed I extended to -3.4 to 3.4



    documentclass{standalone}
    usepackage{pgfplots}

    begin{document}
    begin{tikzpicture}
    begin{axis}[
    xmin=-5, xmax=5,
    grid=both,
    axis lines=middle,
    minor tick num=9,
    axis line style={latex-latex},
    ticklabel style={font=tiny},
    axis equal
    ]
    addplot [domain=-pi:pi,samples=200,red,line width=0.7pt]({3*sin(deg(x))}, {sqrt(3)*cos(deg(x))});
    end{axis}
    end{tikzpicture}

    end{document}


    This is the result running in Gummi.
    enter image description here




    1. a single addplot was used

    2. the graph renders well everywhere

    3. the sample size is much smaller


    EDIT: code modified in response to marmot's comments below.






    share|improve this answer























    • Thank you very much!
      – Gregor Perčič
      2 days ago










    • Perhaps use domain=-pi:pi and it is not necessary to load tikz after pgfplots.
      – marmot
      yesterday










    • Good point about tikz after pgfplots; I also don't need the calc library. I've changed domain to -pi:pi but not sure what happened yesterday when using a numerical approximation for pi didn't work well. Maybe I mistyped the decimal.
      – DJP
      yesterday











    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',
    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%2f463860%2fhow-do-i-plot-an-ellipse-with-addplot-with-using-an-equation%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








    up vote
    2
    down vote



    accepted










    Can use polar coordinates to plot an ellipse. For equation, read polar form of ellipse.



    enter image description here



    This is just a minimum working example. Parameter values has to be adjusted to match exact requirement.



    documentclass[border=3mm]{standalone}
    usepackage{pgfplots}
    %usepackage{tikz}
    %usetikzlibrary{calc}

    begin{document}
    begin{tikzpicture}
    begin{axis}[
    xmin=-5, xmax=5,
    grid=both,
    axis lines=middle,
    minor tick num=9,
    axis line style={latex-latex},
    ticklabel style={font=tiny},
    axis equal
    ]

    addplot[domain=0:360,data cs=polar, samples=200,
    line width=0.7pt, red] (x,{1/(sqrt(0.3-0.2*cos(x)*cos(x)))});
    end{axis}
    end{tikzpicture}
    end{document}





    share|improve this answer



























      up vote
      2
      down vote



      accepted










      Can use polar coordinates to plot an ellipse. For equation, read polar form of ellipse.



      enter image description here



      This is just a minimum working example. Parameter values has to be adjusted to match exact requirement.



      documentclass[border=3mm]{standalone}
      usepackage{pgfplots}
      %usepackage{tikz}
      %usetikzlibrary{calc}

      begin{document}
      begin{tikzpicture}
      begin{axis}[
      xmin=-5, xmax=5,
      grid=both,
      axis lines=middle,
      minor tick num=9,
      axis line style={latex-latex},
      ticklabel style={font=tiny},
      axis equal
      ]

      addplot[domain=0:360,data cs=polar, samples=200,
      line width=0.7pt, red] (x,{1/(sqrt(0.3-0.2*cos(x)*cos(x)))});
      end{axis}
      end{tikzpicture}
      end{document}





      share|improve this answer

























        up vote
        2
        down vote



        accepted







        up vote
        2
        down vote



        accepted






        Can use polar coordinates to plot an ellipse. For equation, read polar form of ellipse.



        enter image description here



        This is just a minimum working example. Parameter values has to be adjusted to match exact requirement.



        documentclass[border=3mm]{standalone}
        usepackage{pgfplots}
        %usepackage{tikz}
        %usetikzlibrary{calc}

        begin{document}
        begin{tikzpicture}
        begin{axis}[
        xmin=-5, xmax=5,
        grid=both,
        axis lines=middle,
        minor tick num=9,
        axis line style={latex-latex},
        ticklabel style={font=tiny},
        axis equal
        ]

        addplot[domain=0:360,data cs=polar, samples=200,
        line width=0.7pt, red] (x,{1/(sqrt(0.3-0.2*cos(x)*cos(x)))});
        end{axis}
        end{tikzpicture}
        end{document}





        share|improve this answer














        Can use polar coordinates to plot an ellipse. For equation, read polar form of ellipse.



        enter image description here



        This is just a minimum working example. Parameter values has to be adjusted to match exact requirement.



        documentclass[border=3mm]{standalone}
        usepackage{pgfplots}
        %usepackage{tikz}
        %usetikzlibrary{calc}

        begin{document}
        begin{tikzpicture}
        begin{axis}[
        xmin=-5, xmax=5,
        grid=both,
        axis lines=middle,
        minor tick num=9,
        axis line style={latex-latex},
        ticklabel style={font=tiny},
        axis equal
        ]

        addplot[domain=0:360,data cs=polar, samples=200,
        line width=0.7pt, red] (x,{1/(sqrt(0.3-0.2*cos(x)*cos(x)))});
        end{axis}
        end{tikzpicture}
        end{document}






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited yesterday

























        answered 2 days ago









        nidhin

        2,714926




        2,714926






















            up vote
            4
            down vote













            These plotting programs are typically for plotting functions, which an ellipse isn't. Besides breaking the relation into two functions, as you've done, it's also possible (and in fact works better to avoid needing so many sample points) to define the ellipse as parametric equations; see the section on converting ellipses. You have to know that deg(x) is needed for syntax to get radians and the domain has to cover a range of 2pi; I've got it going from -pi to pi but 0 to 2pi also works. To make sure less points are needed I extended to -3.4 to 3.4



            documentclass{standalone}
            usepackage{pgfplots}

            begin{document}
            begin{tikzpicture}
            begin{axis}[
            xmin=-5, xmax=5,
            grid=both,
            axis lines=middle,
            minor tick num=9,
            axis line style={latex-latex},
            ticklabel style={font=tiny},
            axis equal
            ]
            addplot [domain=-pi:pi,samples=200,red,line width=0.7pt]({3*sin(deg(x))}, {sqrt(3)*cos(deg(x))});
            end{axis}
            end{tikzpicture}

            end{document}


            This is the result running in Gummi.
            enter image description here




            1. a single addplot was used

            2. the graph renders well everywhere

            3. the sample size is much smaller


            EDIT: code modified in response to marmot's comments below.






            share|improve this answer























            • Thank you very much!
              – Gregor Perčič
              2 days ago










            • Perhaps use domain=-pi:pi and it is not necessary to load tikz after pgfplots.
              – marmot
              yesterday










            • Good point about tikz after pgfplots; I also don't need the calc library. I've changed domain to -pi:pi but not sure what happened yesterday when using a numerical approximation for pi didn't work well. Maybe I mistyped the decimal.
              – DJP
              yesterday















            up vote
            4
            down vote













            These plotting programs are typically for plotting functions, which an ellipse isn't. Besides breaking the relation into two functions, as you've done, it's also possible (and in fact works better to avoid needing so many sample points) to define the ellipse as parametric equations; see the section on converting ellipses. You have to know that deg(x) is needed for syntax to get radians and the domain has to cover a range of 2pi; I've got it going from -pi to pi but 0 to 2pi also works. To make sure less points are needed I extended to -3.4 to 3.4



            documentclass{standalone}
            usepackage{pgfplots}

            begin{document}
            begin{tikzpicture}
            begin{axis}[
            xmin=-5, xmax=5,
            grid=both,
            axis lines=middle,
            minor tick num=9,
            axis line style={latex-latex},
            ticklabel style={font=tiny},
            axis equal
            ]
            addplot [domain=-pi:pi,samples=200,red,line width=0.7pt]({3*sin(deg(x))}, {sqrt(3)*cos(deg(x))});
            end{axis}
            end{tikzpicture}

            end{document}


            This is the result running in Gummi.
            enter image description here




            1. a single addplot was used

            2. the graph renders well everywhere

            3. the sample size is much smaller


            EDIT: code modified in response to marmot's comments below.






            share|improve this answer























            • Thank you very much!
              – Gregor Perčič
              2 days ago










            • Perhaps use domain=-pi:pi and it is not necessary to load tikz after pgfplots.
              – marmot
              yesterday










            • Good point about tikz after pgfplots; I also don't need the calc library. I've changed domain to -pi:pi but not sure what happened yesterday when using a numerical approximation for pi didn't work well. Maybe I mistyped the decimal.
              – DJP
              yesterday













            up vote
            4
            down vote










            up vote
            4
            down vote









            These plotting programs are typically for plotting functions, which an ellipse isn't. Besides breaking the relation into two functions, as you've done, it's also possible (and in fact works better to avoid needing so many sample points) to define the ellipse as parametric equations; see the section on converting ellipses. You have to know that deg(x) is needed for syntax to get radians and the domain has to cover a range of 2pi; I've got it going from -pi to pi but 0 to 2pi also works. To make sure less points are needed I extended to -3.4 to 3.4



            documentclass{standalone}
            usepackage{pgfplots}

            begin{document}
            begin{tikzpicture}
            begin{axis}[
            xmin=-5, xmax=5,
            grid=both,
            axis lines=middle,
            minor tick num=9,
            axis line style={latex-latex},
            ticklabel style={font=tiny},
            axis equal
            ]
            addplot [domain=-pi:pi,samples=200,red,line width=0.7pt]({3*sin(deg(x))}, {sqrt(3)*cos(deg(x))});
            end{axis}
            end{tikzpicture}

            end{document}


            This is the result running in Gummi.
            enter image description here




            1. a single addplot was used

            2. the graph renders well everywhere

            3. the sample size is much smaller


            EDIT: code modified in response to marmot's comments below.






            share|improve this answer














            These plotting programs are typically for plotting functions, which an ellipse isn't. Besides breaking the relation into two functions, as you've done, it's also possible (and in fact works better to avoid needing so many sample points) to define the ellipse as parametric equations; see the section on converting ellipses. You have to know that deg(x) is needed for syntax to get radians and the domain has to cover a range of 2pi; I've got it going from -pi to pi but 0 to 2pi also works. To make sure less points are needed I extended to -3.4 to 3.4



            documentclass{standalone}
            usepackage{pgfplots}

            begin{document}
            begin{tikzpicture}
            begin{axis}[
            xmin=-5, xmax=5,
            grid=both,
            axis lines=middle,
            minor tick num=9,
            axis line style={latex-latex},
            ticklabel style={font=tiny},
            axis equal
            ]
            addplot [domain=-pi:pi,samples=200,red,line width=0.7pt]({3*sin(deg(x))}, {sqrt(3)*cos(deg(x))});
            end{axis}
            end{tikzpicture}

            end{document}


            This is the result running in Gummi.
            enter image description here




            1. a single addplot was used

            2. the graph renders well everywhere

            3. the sample size is much smaller


            EDIT: code modified in response to marmot's comments below.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited yesterday

























            answered 2 days ago









            DJP

            7,02421629




            7,02421629












            • Thank you very much!
              – Gregor Perčič
              2 days ago










            • Perhaps use domain=-pi:pi and it is not necessary to load tikz after pgfplots.
              – marmot
              yesterday










            • Good point about tikz after pgfplots; I also don't need the calc library. I've changed domain to -pi:pi but not sure what happened yesterday when using a numerical approximation for pi didn't work well. Maybe I mistyped the decimal.
              – DJP
              yesterday


















            • Thank you very much!
              – Gregor Perčič
              2 days ago










            • Perhaps use domain=-pi:pi and it is not necessary to load tikz after pgfplots.
              – marmot
              yesterday










            • Good point about tikz after pgfplots; I also don't need the calc library. I've changed domain to -pi:pi but not sure what happened yesterday when using a numerical approximation for pi didn't work well. Maybe I mistyped the decimal.
              – DJP
              yesterday
















            Thank you very much!
            – Gregor Perčič
            2 days ago




            Thank you very much!
            – Gregor Perčič
            2 days ago












            Perhaps use domain=-pi:pi and it is not necessary to load tikz after pgfplots.
            – marmot
            yesterday




            Perhaps use domain=-pi:pi and it is not necessary to load tikz after pgfplots.
            – marmot
            yesterday












            Good point about tikz after pgfplots; I also don't need the calc library. I've changed domain to -pi:pi but not sure what happened yesterday when using a numerical approximation for pi didn't work well. Maybe I mistyped the decimal.
            – DJP
            yesterday




            Good point about tikz after pgfplots; I also don't need the calc library. I've changed domain to -pi:pi but not sure what happened yesterday when using a numerical approximation for pi didn't work well. Maybe I mistyped the decimal.
            – DJP
            yesterday


















            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f463860%2fhow-do-i-plot-an-ellipse-with-addplot-with-using-an-equation%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

            Plaza Victoria

            In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

            How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...