Drawing a sigmoid function and its derivative in tikzRotate a node but not its content: the case of the ellipse decorationTiKZ drawing routine or functionDrawing function in tikzHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?Graph of Derivative functionTikz drawing with functionHow to plot a function and its derivativepgfplots: modify axis after end axis / cut tikzpicture after drawingDrawing a function without knowing its definitionHow to properly arrange group plot for bar chart using pgfplot?

Why doesn't SpaceX land boosters in Africa?

Installed software from source, how to say yum not to install it from package?

Robots in a spaceship

How is it possible for tall trees to pull water to heights more than 10m?

What is the lowest possible AC?

Fitting large table to single page

What is my external HDD doing?

Disk usage buggy: 10G missing on Linux home partition on SSD

Identifying positions of the last TRUEs in a sequence of TRUEs and FALSEs

Odd PCB Layout for Voltage Regulator

My mom helped me cosign a car and now she wants to take it

Two palindromes are not enough

How do I present a future free of gender stereotypes without being jarring or overpowering the narrative?

Where to connect the fuse and why?

Drawing a sigmoid function and its derivative in tikz

How to track mail undetectably?

When should the dialogue reference be written, before or after the dialogue?

Does a lens with a bigger max. aperture focus faster than a lens with a smaller max. aperture?

Could you fall off a planet if it was being accelerated by engines?

Checkmate in 1 on a Tangled Board

Understanding the as-if rule, "the program was executed as written"

Does "boire un jus" tend to mean "coffee" or "juice of fruit"?

How did they film the Invisible Man being invisible in 1933?

How does mmorpg store data?



Drawing a sigmoid function and its derivative in tikz


Rotate a node but not its content: the case of the ellipse decorationTiKZ drawing routine or functionDrawing function in tikzHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?Graph of Derivative functionTikz drawing with functionHow to plot a function and its derivativepgfplots: modify axis after end axis / cut tikzpicture after drawingDrawing a function without knowing its definitionHow to properly arrange group plot for bar chart using pgfplot?













3















I created a graph of the sigmoid function using the following tikz code:



documentclassminimal
usepackagetikz,pgfplots
begindocument
begintikzpicture
beginaxis%
[
grid=major,
xmin=-6,
xmax=6,
axis x line=bottom,
ytick=0,.5,1,
ymax=1,
axis y line=middle,
]
addplot%
[
blue,%
mark=none,
samples=100,
domain=-6:6,
]
(x,1/(1+exp(-x)));
endaxis
endtikzpicture
enddocument


Is it possible to add the derivative of the sigmoid function to the graph using a red dotted line, including a legend in the topright corner for both lines without leaving the tikz environment?



Sigmoid function: σ = 1/(1+exp(-x))



Derivative: σ(x)(1−σ(x)










share|improve this question









New contributor



bjornvandijkman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    3















    I created a graph of the sigmoid function using the following tikz code:



    documentclassminimal
    usepackagetikz,pgfplots
    begindocument
    begintikzpicture
    beginaxis%
    [
    grid=major,
    xmin=-6,
    xmax=6,
    axis x line=bottom,
    ytick=0,.5,1,
    ymax=1,
    axis y line=middle,
    ]
    addplot%
    [
    blue,%
    mark=none,
    samples=100,
    domain=-6:6,
    ]
    (x,1/(1+exp(-x)));
    endaxis
    endtikzpicture
    enddocument


    Is it possible to add the derivative of the sigmoid function to the graph using a red dotted line, including a legend in the topright corner for both lines without leaving the tikz environment?



    Sigmoid function: σ = 1/(1+exp(-x))



    Derivative: σ(x)(1−σ(x)










    share|improve this question









    New contributor



    bjornvandijkman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      3












      3








      3


      1






      I created a graph of the sigmoid function using the following tikz code:



      documentclassminimal
      usepackagetikz,pgfplots
      begindocument
      begintikzpicture
      beginaxis%
      [
      grid=major,
      xmin=-6,
      xmax=6,
      axis x line=bottom,
      ytick=0,.5,1,
      ymax=1,
      axis y line=middle,
      ]
      addplot%
      [
      blue,%
      mark=none,
      samples=100,
      domain=-6:6,
      ]
      (x,1/(1+exp(-x)));
      endaxis
      endtikzpicture
      enddocument


      Is it possible to add the derivative of the sigmoid function to the graph using a red dotted line, including a legend in the topright corner for both lines without leaving the tikz environment?



      Sigmoid function: σ = 1/(1+exp(-x))



      Derivative: σ(x)(1−σ(x)










      share|improve this question









      New contributor



      bjornvandijkman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I created a graph of the sigmoid function using the following tikz code:



      documentclassminimal
      usepackagetikz,pgfplots
      begindocument
      begintikzpicture
      beginaxis%
      [
      grid=major,
      xmin=-6,
      xmax=6,
      axis x line=bottom,
      ytick=0,.5,1,
      ymax=1,
      axis y line=middle,
      ]
      addplot%
      [
      blue,%
      mark=none,
      samples=100,
      domain=-6:6,
      ]
      (x,1/(1+exp(-x)));
      endaxis
      endtikzpicture
      enddocument


      Is it possible to add the derivative of the sigmoid function to the graph using a red dotted line, including a legend in the topright corner for both lines without leaving the tikz environment?



      Sigmoid function: σ = 1/(1+exp(-x))



      Derivative: σ(x)(1−σ(x)







      tikz-pgf






      share|improve this question









      New contributor



      bjornvandijkman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      bjornvandijkman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 8 hours ago







      bjornvandijkman













      New contributor



      bjornvandijkman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 8 hours ago









      bjornvandijkmanbjornvandijkman

      205 bronze badges




      205 bronze badges




      New contributor



      bjornvandijkman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      bjornvandijkman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          5














          The arguably most convenient way is to declare functions with the declare function key, and plot them.



          documentclass[tikz,border=3.14mm]standalone
          usepackagepgfplots
          pgfplotssetcompat=1.16
          begindocument
          begintikzpicture[declare function=sigma(x)=1/(1+exp(-x));
          sigmap(x)=sigma(x)*(1-sigma(x));]
          beginaxis%
          [
          grid=major,
          xmin=-6,
          xmax=6,
          axis x line=bottom,
          ytick=0,.5,1,
          ymax=1,
          axis y line=middle,
          samples=100,
          domain=-6:6,
          legend style=at=(1,0.9)
          ]
          addplot[blue,mark=none] (x,sigma(x));
          addplot[red,dotted,mark=none] (x,sigmap(x));
          legend$sigma(x)$,$sigma'(x)$
          endaxis
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • Perfect, thanks!

            – bjornvandijkman
            7 hours ago











          • @bjornvandijkman You're welcome! You do not necessarily need to do a parametric plot here, addplot[blue,mark=none] sigma(x); will also work.

            – marmot
            6 hours ago













          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
          );



          );






          bjornvandijkman is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f497949%2fdrawing-a-sigmoid-function-and-its-derivative-in-tikz%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









          5














          The arguably most convenient way is to declare functions with the declare function key, and plot them.



          documentclass[tikz,border=3.14mm]standalone
          usepackagepgfplots
          pgfplotssetcompat=1.16
          begindocument
          begintikzpicture[declare function=sigma(x)=1/(1+exp(-x));
          sigmap(x)=sigma(x)*(1-sigma(x));]
          beginaxis%
          [
          grid=major,
          xmin=-6,
          xmax=6,
          axis x line=bottom,
          ytick=0,.5,1,
          ymax=1,
          axis y line=middle,
          samples=100,
          domain=-6:6,
          legend style=at=(1,0.9)
          ]
          addplot[blue,mark=none] (x,sigma(x));
          addplot[red,dotted,mark=none] (x,sigmap(x));
          legend$sigma(x)$,$sigma'(x)$
          endaxis
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • Perfect, thanks!

            – bjornvandijkman
            7 hours ago











          • @bjornvandijkman You're welcome! You do not necessarily need to do a parametric plot here, addplot[blue,mark=none] sigma(x); will also work.

            – marmot
            6 hours ago















          5














          The arguably most convenient way is to declare functions with the declare function key, and plot them.



          documentclass[tikz,border=3.14mm]standalone
          usepackagepgfplots
          pgfplotssetcompat=1.16
          begindocument
          begintikzpicture[declare function=sigma(x)=1/(1+exp(-x));
          sigmap(x)=sigma(x)*(1-sigma(x));]
          beginaxis%
          [
          grid=major,
          xmin=-6,
          xmax=6,
          axis x line=bottom,
          ytick=0,.5,1,
          ymax=1,
          axis y line=middle,
          samples=100,
          domain=-6:6,
          legend style=at=(1,0.9)
          ]
          addplot[blue,mark=none] (x,sigma(x));
          addplot[red,dotted,mark=none] (x,sigmap(x));
          legend$sigma(x)$,$sigma'(x)$
          endaxis
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • Perfect, thanks!

            – bjornvandijkman
            7 hours ago











          • @bjornvandijkman You're welcome! You do not necessarily need to do a parametric plot here, addplot[blue,mark=none] sigma(x); will also work.

            – marmot
            6 hours ago













          5












          5








          5







          The arguably most convenient way is to declare functions with the declare function key, and plot them.



          documentclass[tikz,border=3.14mm]standalone
          usepackagepgfplots
          pgfplotssetcompat=1.16
          begindocument
          begintikzpicture[declare function=sigma(x)=1/(1+exp(-x));
          sigmap(x)=sigma(x)*(1-sigma(x));]
          beginaxis%
          [
          grid=major,
          xmin=-6,
          xmax=6,
          axis x line=bottom,
          ytick=0,.5,1,
          ymax=1,
          axis y line=middle,
          samples=100,
          domain=-6:6,
          legend style=at=(1,0.9)
          ]
          addplot[blue,mark=none] (x,sigma(x));
          addplot[red,dotted,mark=none] (x,sigmap(x));
          legend$sigma(x)$,$sigma'(x)$
          endaxis
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer













          The arguably most convenient way is to declare functions with the declare function key, and plot them.



          documentclass[tikz,border=3.14mm]standalone
          usepackagepgfplots
          pgfplotssetcompat=1.16
          begindocument
          begintikzpicture[declare function=sigma(x)=1/(1+exp(-x));
          sigmap(x)=sigma(x)*(1-sigma(x));]
          beginaxis%
          [
          grid=major,
          xmin=-6,
          xmax=6,
          axis x line=bottom,
          ytick=0,.5,1,
          ymax=1,
          axis y line=middle,
          samples=100,
          domain=-6:6,
          legend style=at=(1,0.9)
          ]
          addplot[blue,mark=none] (x,sigma(x));
          addplot[red,dotted,mark=none] (x,sigmap(x));
          legend$sigma(x)$,$sigma'(x)$
          endaxis
          endtikzpicture
          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 7 hours ago









          marmotmarmot

          140k6 gold badges184 silver badges338 bronze badges




          140k6 gold badges184 silver badges338 bronze badges












          • Perfect, thanks!

            – bjornvandijkman
            7 hours ago











          • @bjornvandijkman You're welcome! You do not necessarily need to do a parametric plot here, addplot[blue,mark=none] sigma(x); will also work.

            – marmot
            6 hours ago

















          • Perfect, thanks!

            – bjornvandijkman
            7 hours ago











          • @bjornvandijkman You're welcome! You do not necessarily need to do a parametric plot here, addplot[blue,mark=none] sigma(x); will also work.

            – marmot
            6 hours ago
















          Perfect, thanks!

          – bjornvandijkman
          7 hours ago





          Perfect, thanks!

          – bjornvandijkman
          7 hours ago













          @bjornvandijkman You're welcome! You do not necessarily need to do a parametric plot here, addplot[blue,mark=none] sigma(x); will also work.

          – marmot
          6 hours ago





          @bjornvandijkman You're welcome! You do not necessarily need to do a parametric plot here, addplot[blue,mark=none] sigma(x); will also work.

          – marmot
          6 hours ago










          bjornvandijkman is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          bjornvandijkman is a new contributor. Be nice, and check out our Code of Conduct.












          bjornvandijkman is a new contributor. Be nice, and check out our Code of Conduct.











          bjornvandijkman is a new contributor. Be nice, and check out our Code of Conduct.














          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%2f497949%2fdrawing-a-sigmoid-function-and-its-derivative-in-tikz%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

          Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

          Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

          In Tikz, how to set a node's label alignment to the left?Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideLine up nested tikz enviroments or how to get rid of themVertically align a tikzpicture and forestDrawing tikz line in the margin for multiple pagesLongtable, contained tikz, padding, custom columns, and an alignment issueTikZ: define arrow starting position based on style and format node labelAlign node name in Tikz