Fluctuating line graph in pfgplotsplotting two time series with boundsGrouped bar chartHow do i get the x...

How much cash can I safely carry into the USA and avoid civil forfeiture?

All ASCII characters with a given bit count

Island of Knights, Knaves and Spies

Zonal Statistics is returning null values in ArcGIS Desktop?

My bank got bought out, am I now going to have to start filing tax returns in a different state?

Is there a grandfather paradox in Endgame?

A strange hotel

Initiative: Do I lose my attack/action if my target moves or dies before my turn in combat?

What is meant by electrons moving to lower potential energy?

How did Captain America manage to do this?

Don’t seats that recline flat defeat the purpose of having seatbelts?

Why must Chinese maps be obfuscated?

Find the identical rows in a matrix

What was Apollo 13's "Little Jolt" after MECO?

How can I get rid of an unhelpful parallel branch when unpivoting a single row?

Nails holding drywall

Older movie/show about humans on derelict alien warship which refuels by passing through a star

A ​Note ​on ​N!

Why did Rep. Omar conclude her criticism of US troops with the phrase "NotTodaySatan"?

Windows Home Server 2011 doesn't install in virtualbox

Why do distances seem to matter in the Foundation world?

Work requires me to come in early to start computer but wont let me clock in to get paid for it

Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?

How do I reattach a shelf to the wall when it ripped out of the wall?



Fluctuating line graph in pfgplots


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 originSine function in pgfplots and MATLAB. Why are different results obtained?How to use loops to improve TikZ/pgfplots-based animation?













3















I'd like to plot the following function between 0 and 0.5 using pgfplots.



function to plot



However I get as a result the fluctuating line in picture. I'd like to get a smooth line, as the function is.



Is this a numerical approximation error?



Here is a mwe



documentclass[tikz]{standalone}
usepackage{pgfplots}

begin{document}
begin{tikzpicture}
begin{axis}[axis x line=middle, axis y line=middle,
width=linewidth, height=0.5linewidth,
xmin = 0, xmax=0.5]
addplot[smooth, domain=0:0.5, samples = 100] {
exp(0.1*x)-sin(deg(0.1*x))
};
end{axis}
end{tikzpicture}
end{document}


Output:



Result I get










share|improve this question



























    3















    I'd like to plot the following function between 0 and 0.5 using pgfplots.



    function to plot



    However I get as a result the fluctuating line in picture. I'd like to get a smooth line, as the function is.



    Is this a numerical approximation error?



    Here is a mwe



    documentclass[tikz]{standalone}
    usepackage{pgfplots}

    begin{document}
    begin{tikzpicture}
    begin{axis}[axis x line=middle, axis y line=middle,
    width=linewidth, height=0.5linewidth,
    xmin = 0, xmax=0.5]
    addplot[smooth, domain=0:0.5, samples = 100] {
    exp(0.1*x)-sin(deg(0.1*x))
    };
    end{axis}
    end{tikzpicture}
    end{document}


    Output:



    Result I get










    share|improve this question

























      3












      3








      3








      I'd like to plot the following function between 0 and 0.5 using pgfplots.



      function to plot



      However I get as a result the fluctuating line in picture. I'd like to get a smooth line, as the function is.



      Is this a numerical approximation error?



      Here is a mwe



      documentclass[tikz]{standalone}
      usepackage{pgfplots}

      begin{document}
      begin{tikzpicture}
      begin{axis}[axis x line=middle, axis y line=middle,
      width=linewidth, height=0.5linewidth,
      xmin = 0, xmax=0.5]
      addplot[smooth, domain=0:0.5, samples = 100] {
      exp(0.1*x)-sin(deg(0.1*x))
      };
      end{axis}
      end{tikzpicture}
      end{document}


      Output:



      Result I get










      share|improve this question














      I'd like to plot the following function between 0 and 0.5 using pgfplots.



      function to plot



      However I get as a result the fluctuating line in picture. I'd like to get a smooth line, as the function is.



      Is this a numerical approximation error?



      Here is a mwe



      documentclass[tikz]{standalone}
      usepackage{pgfplots}

      begin{document}
      begin{tikzpicture}
      begin{axis}[axis x line=middle, axis y line=middle,
      width=linewidth, height=0.5linewidth,
      xmin = 0, xmax=0.5]
      addplot[smooth, domain=0:0.5, samples = 100] {
      exp(0.1*x)-sin(deg(0.1*x))
      };
      end{axis}
      end{tikzpicture}
      end{document}


      Output:



      Result I get







      pgfplots






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 12 hours ago









      AlexAlex

      1233




      1233






















          1 Answer
          1






          active

          oldest

          votes


















          3














          Yes, these are numerical issues. In what follows I describe two ways to resolve them: using lualatex as compiler or using xfp for the computation. Both of them give smooth results, which agree.



          Once I add pgfplotsset{compat=1.16} and compile



          documentclass[tikz]{standalone}
          usepackage{pgfplots}
          pgfplotsset{compat=1.16}
          begin{document}
          begin{tikzpicture}
          begin{axis}[axis x line=middle, axis y line=middle,
          width=linewidth, height=0.5linewidth,
          xmin = 0, xmax=0.5]
          addplot[smooth, domain=0:0.5, samples = 100] {
          exp(0.1*x)-sin(deg(0.1*x))
          };
          end{axis}
          end{tikzpicture}
          end{document}


          with lualatex I get



          enter image description here



          If you do not want to use lualatex you could employ xfp instead.



          documentclass[tikz]{standalone}
          usepackage{pgfplots}
          %pgfplotsset{compat=1.16}
          usepackage{xfp}
          begin{document}
          begin{tikzpicture}
          foreach X [count=Y] in {0,0.005,...,0.5}
          {ifnumY=1
          xdefLst{(X,fpeval{exp(0.1*X)-sin(0.1*X)})}
          else
          xdefLst{Lst (X,fpeval{exp(0.1*X)-sin(0.1*X)})}
          fi}
          begin{axis}[axis x line=middle, axis y line=middle,
          width=linewidth, height=0.5linewidth,
          xmin = 0, xmax=0.5,ytick=empty]
          addplot[smooth,no marks] coordinates {Lst};
          end{axis}
          end{tikzpicture}
          end{document}


          enter image description here






          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%2f487635%2ffluctuating-line-graph-in-pfgplots%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









            3














            Yes, these are numerical issues. In what follows I describe two ways to resolve them: using lualatex as compiler or using xfp for the computation. Both of them give smooth results, which agree.



            Once I add pgfplotsset{compat=1.16} and compile



            documentclass[tikz]{standalone}
            usepackage{pgfplots}
            pgfplotsset{compat=1.16}
            begin{document}
            begin{tikzpicture}
            begin{axis}[axis x line=middle, axis y line=middle,
            width=linewidth, height=0.5linewidth,
            xmin = 0, xmax=0.5]
            addplot[smooth, domain=0:0.5, samples = 100] {
            exp(0.1*x)-sin(deg(0.1*x))
            };
            end{axis}
            end{tikzpicture}
            end{document}


            with lualatex I get



            enter image description here



            If you do not want to use lualatex you could employ xfp instead.



            documentclass[tikz]{standalone}
            usepackage{pgfplots}
            %pgfplotsset{compat=1.16}
            usepackage{xfp}
            begin{document}
            begin{tikzpicture}
            foreach X [count=Y] in {0,0.005,...,0.5}
            {ifnumY=1
            xdefLst{(X,fpeval{exp(0.1*X)-sin(0.1*X)})}
            else
            xdefLst{Lst (X,fpeval{exp(0.1*X)-sin(0.1*X)})}
            fi}
            begin{axis}[axis x line=middle, axis y line=middle,
            width=linewidth, height=0.5linewidth,
            xmin = 0, xmax=0.5,ytick=empty]
            addplot[smooth,no marks] coordinates {Lst};
            end{axis}
            end{tikzpicture}
            end{document}


            enter image description here






            share|improve this answer






























              3














              Yes, these are numerical issues. In what follows I describe two ways to resolve them: using lualatex as compiler or using xfp for the computation. Both of them give smooth results, which agree.



              Once I add pgfplotsset{compat=1.16} and compile



              documentclass[tikz]{standalone}
              usepackage{pgfplots}
              pgfplotsset{compat=1.16}
              begin{document}
              begin{tikzpicture}
              begin{axis}[axis x line=middle, axis y line=middle,
              width=linewidth, height=0.5linewidth,
              xmin = 0, xmax=0.5]
              addplot[smooth, domain=0:0.5, samples = 100] {
              exp(0.1*x)-sin(deg(0.1*x))
              };
              end{axis}
              end{tikzpicture}
              end{document}


              with lualatex I get



              enter image description here



              If you do not want to use lualatex you could employ xfp instead.



              documentclass[tikz]{standalone}
              usepackage{pgfplots}
              %pgfplotsset{compat=1.16}
              usepackage{xfp}
              begin{document}
              begin{tikzpicture}
              foreach X [count=Y] in {0,0.005,...,0.5}
              {ifnumY=1
              xdefLst{(X,fpeval{exp(0.1*X)-sin(0.1*X)})}
              else
              xdefLst{Lst (X,fpeval{exp(0.1*X)-sin(0.1*X)})}
              fi}
              begin{axis}[axis x line=middle, axis y line=middle,
              width=linewidth, height=0.5linewidth,
              xmin = 0, xmax=0.5,ytick=empty]
              addplot[smooth,no marks] coordinates {Lst};
              end{axis}
              end{tikzpicture}
              end{document}


              enter image description here






              share|improve this answer




























                3












                3








                3







                Yes, these are numerical issues. In what follows I describe two ways to resolve them: using lualatex as compiler or using xfp for the computation. Both of them give smooth results, which agree.



                Once I add pgfplotsset{compat=1.16} and compile



                documentclass[tikz]{standalone}
                usepackage{pgfplots}
                pgfplotsset{compat=1.16}
                begin{document}
                begin{tikzpicture}
                begin{axis}[axis x line=middle, axis y line=middle,
                width=linewidth, height=0.5linewidth,
                xmin = 0, xmax=0.5]
                addplot[smooth, domain=0:0.5, samples = 100] {
                exp(0.1*x)-sin(deg(0.1*x))
                };
                end{axis}
                end{tikzpicture}
                end{document}


                with lualatex I get



                enter image description here



                If you do not want to use lualatex you could employ xfp instead.



                documentclass[tikz]{standalone}
                usepackage{pgfplots}
                %pgfplotsset{compat=1.16}
                usepackage{xfp}
                begin{document}
                begin{tikzpicture}
                foreach X [count=Y] in {0,0.005,...,0.5}
                {ifnumY=1
                xdefLst{(X,fpeval{exp(0.1*X)-sin(0.1*X)})}
                else
                xdefLst{Lst (X,fpeval{exp(0.1*X)-sin(0.1*X)})}
                fi}
                begin{axis}[axis x line=middle, axis y line=middle,
                width=linewidth, height=0.5linewidth,
                xmin = 0, xmax=0.5,ytick=empty]
                addplot[smooth,no marks] coordinates {Lst};
                end{axis}
                end{tikzpicture}
                end{document}


                enter image description here






                share|improve this answer















                Yes, these are numerical issues. In what follows I describe two ways to resolve them: using lualatex as compiler or using xfp for the computation. Both of them give smooth results, which agree.



                Once I add pgfplotsset{compat=1.16} and compile



                documentclass[tikz]{standalone}
                usepackage{pgfplots}
                pgfplotsset{compat=1.16}
                begin{document}
                begin{tikzpicture}
                begin{axis}[axis x line=middle, axis y line=middle,
                width=linewidth, height=0.5linewidth,
                xmin = 0, xmax=0.5]
                addplot[smooth, domain=0:0.5, samples = 100] {
                exp(0.1*x)-sin(deg(0.1*x))
                };
                end{axis}
                end{tikzpicture}
                end{document}


                with lualatex I get



                enter image description here



                If you do not want to use lualatex you could employ xfp instead.



                documentclass[tikz]{standalone}
                usepackage{pgfplots}
                %pgfplotsset{compat=1.16}
                usepackage{xfp}
                begin{document}
                begin{tikzpicture}
                foreach X [count=Y] in {0,0.005,...,0.5}
                {ifnumY=1
                xdefLst{(X,fpeval{exp(0.1*X)-sin(0.1*X)})}
                else
                xdefLst{Lst (X,fpeval{exp(0.1*X)-sin(0.1*X)})}
                fi}
                begin{axis}[axis x line=middle, axis y line=middle,
                width=linewidth, height=0.5linewidth,
                xmin = 0, xmax=0.5,ytick=empty]
                addplot[smooth,no marks] coordinates {Lst};
                end{axis}
                end{tikzpicture}
                end{document}


                enter image description here







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 8 hours ago

























                answered 11 hours ago









                marmotmarmot

                121k6158297




                121k6158297






























                    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%2f487635%2ffluctuating-line-graph-in-pfgplots%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

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

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

                    Playhouse Disney Channel (Latinoamérica) Índice Historia Programación Programación especial Sitio...