How to plot a function for big range of values?plotting two time series with boundsGrouped bar chartHow do i...

can anyone help me with this awful query plan?

If a planet has 3 moons, is it possible to have triple Full/New Moons at once?

Why did C use the -> operator instead of reusing the . operator?

What happens to Mjolnir (Thor's hammer) at the end of Endgame?

Does tea made with boiling water cool faster than tea made with boiled (but still hot) water?

Is there a way to generate a list of distinct numbers such that no two subsets ever have an equal sum?

Map of water taps to fill bottles

Minor Revision with suggestion of an alternative proof by reviewer

"The cow" OR "a cow" OR "cows" in this context

Aliens crash on Earth and go into stasis to wait for technology to fix their ship

Two field separators (colon and space) in awk

Pre-plastic human skin alternative

Apply MapThread to all but one variable

Classification of surfaces

Is there any official lore on the Far Realm?

Do I have an "anti-research" personality?

Can we say “you can pay when the order gets ready”?

How to pronounce 'c++' in Spanish

Could the terminal length of components like resistors be reduced?

Why must Chinese maps be obfuscated?

How do I check if a string is entirely made of the same substring?

How did Captain America manage to do this?

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

What are the characteristics of a typeless programming language?



How to plot a function for big range of values?


plotting two time series with boundsGrouped bar chartHow do i get the x axis on top but keep a line on the bottomHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?How to hide empty (value 0) ybars with pgfplots?Show mark labels near marks and not centered in ybar interaval graphpgfplots: percentage in matrix plotCenter the axes in the coordinate originPlot a function between two valuespgfplots: modify axis after end axis / cut tikzpicture after drawing













1















I use Maple to plot the funtion f(x) = x*(x-6)*(x-12)*(x-20), where x = -.8 .. 21.



enter image description here



I tried to draw it by pgfplots, but I can not get the result.



documentclass[tikz]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
usepackage{fouriernc}
usepackage{tikz}
pgfplotsset{every axis/.append style={
axis x line=middle,
axis y line=middle,
xlabel={$x$},
ylabel={$y$},
},
framed/.style={axis background/.style ={draw=black}},
}

% arrow style
tikzset{>=stealth}

begin{document}
begin{tikzpicture}[
declare function={
f(x)=x*(x-6)*(x-12)*(x-20);
}
]
begin{axis}[
framed, grid=both,
axis equal,
axis x line=middle, axis y line=middle,
axis line style = very thick,
ymin=-1.5, ymax=20,
yticklabels={},
width=22 cm,
height=2850cm, xticklabels={},
samples=500,
]
addplot[blue, very thick,domain=-1:21, smooth]{f(x)};
end{axis}
end{tikzpicture}
end{document}


How can I draw it?










share|improve this question























  • The function is not the real problem. The main issue is height=2850cm,. How high should the plot really be?

    – marmot
    11 mins ago











  • @marmot Is there a way to draw? The height=2850cm, I tried a any number. You can change it.

    – minhthien_2016
    9 mins ago


















1















I use Maple to plot the funtion f(x) = x*(x-6)*(x-12)*(x-20), where x = -.8 .. 21.



enter image description here



I tried to draw it by pgfplots, but I can not get the result.



documentclass[tikz]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
usepackage{fouriernc}
usepackage{tikz}
pgfplotsset{every axis/.append style={
axis x line=middle,
axis y line=middle,
xlabel={$x$},
ylabel={$y$},
},
framed/.style={axis background/.style ={draw=black}},
}

% arrow style
tikzset{>=stealth}

begin{document}
begin{tikzpicture}[
declare function={
f(x)=x*(x-6)*(x-12)*(x-20);
}
]
begin{axis}[
framed, grid=both,
axis equal,
axis x line=middle, axis y line=middle,
axis line style = very thick,
ymin=-1.5, ymax=20,
yticklabels={},
width=22 cm,
height=2850cm, xticklabels={},
samples=500,
]
addplot[blue, very thick,domain=-1:21, smooth]{f(x)};
end{axis}
end{tikzpicture}
end{document}


How can I draw it?










share|improve this question























  • The function is not the real problem. The main issue is height=2850cm,. How high should the plot really be?

    – marmot
    11 mins ago











  • @marmot Is there a way to draw? The height=2850cm, I tried a any number. You can change it.

    – minhthien_2016
    9 mins ago
















1












1








1








I use Maple to plot the funtion f(x) = x*(x-6)*(x-12)*(x-20), where x = -.8 .. 21.



enter image description here



I tried to draw it by pgfplots, but I can not get the result.



documentclass[tikz]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
usepackage{fouriernc}
usepackage{tikz}
pgfplotsset{every axis/.append style={
axis x line=middle,
axis y line=middle,
xlabel={$x$},
ylabel={$y$},
},
framed/.style={axis background/.style ={draw=black}},
}

% arrow style
tikzset{>=stealth}

begin{document}
begin{tikzpicture}[
declare function={
f(x)=x*(x-6)*(x-12)*(x-20);
}
]
begin{axis}[
framed, grid=both,
axis equal,
axis x line=middle, axis y line=middle,
axis line style = very thick,
ymin=-1.5, ymax=20,
yticklabels={},
width=22 cm,
height=2850cm, xticklabels={},
samples=500,
]
addplot[blue, very thick,domain=-1:21, smooth]{f(x)};
end{axis}
end{tikzpicture}
end{document}


How can I draw it?










share|improve this question














I use Maple to plot the funtion f(x) = x*(x-6)*(x-12)*(x-20), where x = -.8 .. 21.



enter image description here



I tried to draw it by pgfplots, but I can not get the result.



documentclass[tikz]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
usepackage{fouriernc}
usepackage{tikz}
pgfplotsset{every axis/.append style={
axis x line=middle,
axis y line=middle,
xlabel={$x$},
ylabel={$y$},
},
framed/.style={axis background/.style ={draw=black}},
}

% arrow style
tikzset{>=stealth}

begin{document}
begin{tikzpicture}[
declare function={
f(x)=x*(x-6)*(x-12)*(x-20);
}
]
begin{axis}[
framed, grid=both,
axis equal,
axis x line=middle, axis y line=middle,
axis line style = very thick,
ymin=-1.5, ymax=20,
yticklabels={},
width=22 cm,
height=2850cm, xticklabels={},
samples=500,
]
addplot[blue, very thick,domain=-1:21, smooth]{f(x)};
end{axis}
end{tikzpicture}
end{document}


How can I draw it?







pgfplots






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 26 mins ago









minhthien_2016minhthien_2016

1,4911917




1,4911917













  • The function is not the real problem. The main issue is height=2850cm,. How high should the plot really be?

    – marmot
    11 mins ago











  • @marmot Is there a way to draw? The height=2850cm, I tried a any number. You can change it.

    – minhthien_2016
    9 mins ago





















  • The function is not the real problem. The main issue is height=2850cm,. How high should the plot really be?

    – marmot
    11 mins ago











  • @marmot Is there a way to draw? The height=2850cm, I tried a any number. You can change it.

    – minhthien_2016
    9 mins ago



















The function is not the real problem. The main issue is height=2850cm,. How high should the plot really be?

– marmot
11 mins ago





The function is not the real problem. The main issue is height=2850cm,. How high should the plot really be?

– marmot
11 mins ago













@marmot Is there a way to draw? The height=2850cm, I tried a any number. You can change it.

– minhthien_2016
9 mins ago







@marmot Is there a way to draw? The height=2850cm, I tried a any number. You can change it.

– minhthien_2016
9 mins ago












1 Answer
1






active

oldest

votes


















0














You get a plot that looks IMHO very decent if you drop axis equal,ymin=-1.5, ymax=20, and the enormous dimensions. axis equal says that the units in x and y directions should coincide, but you know from your Maple plot that in the specified domain the plot varies by roughly 5000 in y direction, so there is no way to reconcile this with a domain of only 21 units in x direction. Of course, if you cut the plot by saying ymin=-1.5, ymax=20, you will cut away pretty much everything. However, if you drop all this you get



documentclass[tikz]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.16}
usepackage{fouriernc}
pgfplotsset{every axis/.append style={
axis x line=middle,
axis y line=middle,
xlabel={$x$},
ylabel={$y$},
},
framed/.style={axis background/.style ={draw=black}},
}

% arrow style
tikzset{>=stealth}

begin{document}
begin{tikzpicture}[
declare function={f(x)=x*(x-6)*(x-12)*(x-20);%
}
]
begin{axis}[
framed, grid=both,
%axis equal,
axis x line=middle, axis y line=middle,
axis line style = very thick,
%ymin=-1.5, ymax=20,
yticklabels={},
width=12cm,
%height=0.4*28.50cm,
xticklabels={},
samples=50,
]
addplot[blue, very thick,domain=-1:21, smooth]{f(x)};
end{axis}
end{tikzpicture}
end{document}


enter image description here



which looks very much like the Maple plot.





share
























    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%2f487859%2fhow-to-plot-a-function-for-big-range-of-values%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You get a plot that looks IMHO very decent if you drop axis equal,ymin=-1.5, ymax=20, and the enormous dimensions. axis equal says that the units in x and y directions should coincide, but you know from your Maple plot that in the specified domain the plot varies by roughly 5000 in y direction, so there is no way to reconcile this with a domain of only 21 units in x direction. Of course, if you cut the plot by saying ymin=-1.5, ymax=20, you will cut away pretty much everything. However, if you drop all this you get



    documentclass[tikz]{standalone}
    usepackage{pgfplots}
    pgfplotsset{compat=1.16}
    usepackage{fouriernc}
    pgfplotsset{every axis/.append style={
    axis x line=middle,
    axis y line=middle,
    xlabel={$x$},
    ylabel={$y$},
    },
    framed/.style={axis background/.style ={draw=black}},
    }

    % arrow style
    tikzset{>=stealth}

    begin{document}
    begin{tikzpicture}[
    declare function={f(x)=x*(x-6)*(x-12)*(x-20);%
    }
    ]
    begin{axis}[
    framed, grid=both,
    %axis equal,
    axis x line=middle, axis y line=middle,
    axis line style = very thick,
    %ymin=-1.5, ymax=20,
    yticklabels={},
    width=12cm,
    %height=0.4*28.50cm,
    xticklabels={},
    samples=50,
    ]
    addplot[blue, very thick,domain=-1:21, smooth]{f(x)};
    end{axis}
    end{tikzpicture}
    end{document}


    enter image description here



    which looks very much like the Maple plot.





    share




























      0














      You get a plot that looks IMHO very decent if you drop axis equal,ymin=-1.5, ymax=20, and the enormous dimensions. axis equal says that the units in x and y directions should coincide, but you know from your Maple plot that in the specified domain the plot varies by roughly 5000 in y direction, so there is no way to reconcile this with a domain of only 21 units in x direction. Of course, if you cut the plot by saying ymin=-1.5, ymax=20, you will cut away pretty much everything. However, if you drop all this you get



      documentclass[tikz]{standalone}
      usepackage{pgfplots}
      pgfplotsset{compat=1.16}
      usepackage{fouriernc}
      pgfplotsset{every axis/.append style={
      axis x line=middle,
      axis y line=middle,
      xlabel={$x$},
      ylabel={$y$},
      },
      framed/.style={axis background/.style ={draw=black}},
      }

      % arrow style
      tikzset{>=stealth}

      begin{document}
      begin{tikzpicture}[
      declare function={f(x)=x*(x-6)*(x-12)*(x-20);%
      }
      ]
      begin{axis}[
      framed, grid=both,
      %axis equal,
      axis x line=middle, axis y line=middle,
      axis line style = very thick,
      %ymin=-1.5, ymax=20,
      yticklabels={},
      width=12cm,
      %height=0.4*28.50cm,
      xticklabels={},
      samples=50,
      ]
      addplot[blue, very thick,domain=-1:21, smooth]{f(x)};
      end{axis}
      end{tikzpicture}
      end{document}


      enter image description here



      which looks very much like the Maple plot.





      share


























        0












        0








        0







        You get a plot that looks IMHO very decent if you drop axis equal,ymin=-1.5, ymax=20, and the enormous dimensions. axis equal says that the units in x and y directions should coincide, but you know from your Maple plot that in the specified domain the plot varies by roughly 5000 in y direction, so there is no way to reconcile this with a domain of only 21 units in x direction. Of course, if you cut the plot by saying ymin=-1.5, ymax=20, you will cut away pretty much everything. However, if you drop all this you get



        documentclass[tikz]{standalone}
        usepackage{pgfplots}
        pgfplotsset{compat=1.16}
        usepackage{fouriernc}
        pgfplotsset{every axis/.append style={
        axis x line=middle,
        axis y line=middle,
        xlabel={$x$},
        ylabel={$y$},
        },
        framed/.style={axis background/.style ={draw=black}},
        }

        % arrow style
        tikzset{>=stealth}

        begin{document}
        begin{tikzpicture}[
        declare function={f(x)=x*(x-6)*(x-12)*(x-20);%
        }
        ]
        begin{axis}[
        framed, grid=both,
        %axis equal,
        axis x line=middle, axis y line=middle,
        axis line style = very thick,
        %ymin=-1.5, ymax=20,
        yticklabels={},
        width=12cm,
        %height=0.4*28.50cm,
        xticklabels={},
        samples=50,
        ]
        addplot[blue, very thick,domain=-1:21, smooth]{f(x)};
        end{axis}
        end{tikzpicture}
        end{document}


        enter image description here



        which looks very much like the Maple plot.





        share













        You get a plot that looks IMHO very decent if you drop axis equal,ymin=-1.5, ymax=20, and the enormous dimensions. axis equal says that the units in x and y directions should coincide, but you know from your Maple plot that in the specified domain the plot varies by roughly 5000 in y direction, so there is no way to reconcile this with a domain of only 21 units in x direction. Of course, if you cut the plot by saying ymin=-1.5, ymax=20, you will cut away pretty much everything. However, if you drop all this you get



        documentclass[tikz]{standalone}
        usepackage{pgfplots}
        pgfplotsset{compat=1.16}
        usepackage{fouriernc}
        pgfplotsset{every axis/.append style={
        axis x line=middle,
        axis y line=middle,
        xlabel={$x$},
        ylabel={$y$},
        },
        framed/.style={axis background/.style ={draw=black}},
        }

        % arrow style
        tikzset{>=stealth}

        begin{document}
        begin{tikzpicture}[
        declare function={f(x)=x*(x-6)*(x-12)*(x-20);%
        }
        ]
        begin{axis}[
        framed, grid=both,
        %axis equal,
        axis x line=middle, axis y line=middle,
        axis line style = very thick,
        %ymin=-1.5, ymax=20,
        yticklabels={},
        width=12cm,
        %height=0.4*28.50cm,
        xticklabels={},
        samples=50,
        ]
        addplot[blue, very thick,domain=-1:21, smooth]{f(x)};
        end{axis}
        end{tikzpicture}
        end{document}


        enter image description here



        which looks very much like the Maple plot.






        share











        share


        share










        answered 5 mins ago









        marmotmarmot

        121k6159297




        121k6159297






























            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%2f487859%2fhow-to-plot-a-function-for-big-range-of-values%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...

            Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...

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