Fill area under curve using colourmap and TikzHow to fill area under plot using a color map?Filling area between curve and circle using TikZPgfplots: how to fill bounded area under a curve using addplot and fill?Tikz-picture - Fill areaTikz - Fill circle/sinus areaFillbetween doesn't fill entire area under graphFill area under a smooth curveShading area under curve TikZRiemann Sum approaches Area under Curvehow to fill the area under a curve

How do I find out when a node was added to an availability group?

Plain language with long required phrases

What mechanic is there to disable a threat instead of killing it?

What killed these X2 caps?

Can I use a neutral wire from another outlet to repair a broken neutral?

How much of data wrangling is a data scientist's job?

How do I write bicross product symbols in latex?

Is it canonical bit space?

Why are electrically insulating heatsinks so rare? Is it just cost?

What is the word for reserving something for yourself before others do?

What is the intuition behind short exact sequences of groups; in particular, what is the intuition behind group extensions?

Withdrawals from HSA

Alternative to sending password over mail?

Twin primes whose sum is a cube

How can saying a song's name be a copyright violation?

Can a virus destroy the BIOS of a modern computer?

What exploit are these user agents trying to use?

I'm flying to France today and my passport expires in less than 2 months

Etiquette around loan refinance - decision is going to cost first broker a lot of money

Infinite Abelian subgroup of infinite non Abelian group example

How to model explosives?

What does it mean to describe someone as a butt steak?

Could gravitational lensing be used to protect a spaceship from a laser?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?



Fill area under curve using colourmap and Tikz


How to fill area under plot using a color map?Filling area between curve and circle using TikZPgfplots: how to fill bounded area under a curve using addplot and fill?Tikz-picture - Fill areaTikz - Fill circle/sinus areaFillbetween doesn't fill entire area under graphFill area under a smooth curveShading area under curve TikZRiemann Sum approaches Area under Curvehow to fill the area under a curve













1















I'd like to use a colourmap like hot2 in this plot, where red occurs at x=0, and green occurs at x=1, but I can't find any way of doing it.



Here's what I have so far:



 begintikzpicture
beginaxis[
axis lines=left,
grid=major,
no marks,
xmin=0, xmax=1, xlabel=$E$,
ymin=0, ymax=1, ylabel=$lambda$, ylabel style=rotate=-90
]
addplot+[smooth,blue,name path=A] 1 - (1 - x)^2; % actual curve
addplot+[draw=none,name path=B] 0; % “fictional” curve
addplot+[green] fill between[of=A and B,soft clip=domain=0:1]; % filling
endaxis
endtikzpicture


Current










share|improve this question







New contributor




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
























    1















    I'd like to use a colourmap like hot2 in this plot, where red occurs at x=0, and green occurs at x=1, but I can't find any way of doing it.



    Here's what I have so far:



     begintikzpicture
    beginaxis[
    axis lines=left,
    grid=major,
    no marks,
    xmin=0, xmax=1, xlabel=$E$,
    ymin=0, ymax=1, ylabel=$lambda$, ylabel style=rotate=-90
    ]
    addplot+[smooth,blue,name path=A] 1 - (1 - x)^2; % actual curve
    addplot+[draw=none,name path=B] 0; % “fictional” curve
    addplot+[green] fill between[of=A and B,soft clip=domain=0:1]; % filling
    endaxis
    endtikzpicture


    Current










    share|improve this question







    New contributor




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






















      1












      1








      1


      1






      I'd like to use a colourmap like hot2 in this plot, where red occurs at x=0, and green occurs at x=1, but I can't find any way of doing it.



      Here's what I have so far:



       begintikzpicture
      beginaxis[
      axis lines=left,
      grid=major,
      no marks,
      xmin=0, xmax=1, xlabel=$E$,
      ymin=0, ymax=1, ylabel=$lambda$, ylabel style=rotate=-90
      ]
      addplot+[smooth,blue,name path=A] 1 - (1 - x)^2; % actual curve
      addplot+[draw=none,name path=B] 0; % “fictional” curve
      addplot+[green] fill between[of=A and B,soft clip=domain=0:1]; % filling
      endaxis
      endtikzpicture


      Current










      share|improve this question







      New contributor




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












      I'd like to use a colourmap like hot2 in this plot, where red occurs at x=0, and green occurs at x=1, but I can't find any way of doing it.



      Here's what I have so far:



       begintikzpicture
      beginaxis[
      axis lines=left,
      grid=major,
      no marks,
      xmin=0, xmax=1, xlabel=$E$,
      ymin=0, ymax=1, ylabel=$lambda$, ylabel style=rotate=-90
      ]
      addplot+[smooth,blue,name path=A] 1 - (1 - x)^2; % actual curve
      addplot+[draw=none,name path=B] 0; % “fictional” curve
      addplot+[green] fill between[of=A and B,soft clip=domain=0:1]; % filling
      endaxis
      endtikzpicture


      Current







      tikz-pgf graphics tikz-styles






      share|improve this question







      New contributor




      Jordan Mackie 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




      Jordan Mackie 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






      New contributor




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









      asked 4 hours ago









      Jordan MackieJordan Mackie

      1084




      1084




      New contributor




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





      New contributor





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






      Jordan Mackie 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


















          1














          Welcome to TeX-SE! We usually begin our examples with documentclass, end them with enddocument and do not put non-standard characters in the code that prevents others from copying it. The following is an example of an MWE.



          documentclass[tikz,border=3.14mm]standalone 
          usepackagepgfplots
          pgfplotssetcompat=1.16
          newsaveboxbackbox
          pgfplotscolormaptoshadingspechot7cmresult
          deftempbpgfdeclarehorizontalshadingtempshading7cm%
          % where 'result' is inserted as last argument:
          expandaftertempbexpandafterresult%
          sboxbackboxpgfuseshadingtempshading%
          begindocument
          begintikzpicture
          beginaxis[set layers,view=900,
          axis lines=left,
          grid=major,
          no marks,
          xmin=0, xmax=1, xlabel=$E$,
          ymin=0, ymax=1, ylabel=$lambda$, ylabel style=rotate=-90
          ]
          addplot+[smooth,blue] 1 - (1 - x)^2; % actual curve
          beginpgfonlayerpre main
          clip plot[variable=x,samples=25,domain=0:1] (x,1 - (1 - x)^2)
          |-cycle;
          node at (0.5,0.5)useboxbackbox;
          endpgfonlayer
          % filling
          endaxis
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • Perfect thank you!

            – Jordan Mackie
            3 hours ago











          • It works , but I do get an error: ! Undefined control sequence. <argument> backbox l.41 sboxbackboxpgfuseshadingtempshading % ?

            – Jordan Mackie
            3 hours ago












          • @JordanMackie Sorry, these statements seem to contradict each other: "it works" and "I get an error". I get this very output from running pdflatex on the above code, of course without error message.

            – marmot
            2 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
          );



          );






          Jordan Mackie 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%2f483209%2ffill-area-under-curve-using-colourmap-and-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









          1














          Welcome to TeX-SE! We usually begin our examples with documentclass, end them with enddocument and do not put non-standard characters in the code that prevents others from copying it. The following is an example of an MWE.



          documentclass[tikz,border=3.14mm]standalone 
          usepackagepgfplots
          pgfplotssetcompat=1.16
          newsaveboxbackbox
          pgfplotscolormaptoshadingspechot7cmresult
          deftempbpgfdeclarehorizontalshadingtempshading7cm%
          % where 'result' is inserted as last argument:
          expandaftertempbexpandafterresult%
          sboxbackboxpgfuseshadingtempshading%
          begindocument
          begintikzpicture
          beginaxis[set layers,view=900,
          axis lines=left,
          grid=major,
          no marks,
          xmin=0, xmax=1, xlabel=$E$,
          ymin=0, ymax=1, ylabel=$lambda$, ylabel style=rotate=-90
          ]
          addplot+[smooth,blue] 1 - (1 - x)^2; % actual curve
          beginpgfonlayerpre main
          clip plot[variable=x,samples=25,domain=0:1] (x,1 - (1 - x)^2)
          |-cycle;
          node at (0.5,0.5)useboxbackbox;
          endpgfonlayer
          % filling
          endaxis
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • Perfect thank you!

            – Jordan Mackie
            3 hours ago











          • It works , but I do get an error: ! Undefined control sequence. <argument> backbox l.41 sboxbackboxpgfuseshadingtempshading % ?

            – Jordan Mackie
            3 hours ago












          • @JordanMackie Sorry, these statements seem to contradict each other: "it works" and "I get an error". I get this very output from running pdflatex on the above code, of course without error message.

            – marmot
            2 hours ago















          1














          Welcome to TeX-SE! We usually begin our examples with documentclass, end them with enddocument and do not put non-standard characters in the code that prevents others from copying it. The following is an example of an MWE.



          documentclass[tikz,border=3.14mm]standalone 
          usepackagepgfplots
          pgfplotssetcompat=1.16
          newsaveboxbackbox
          pgfplotscolormaptoshadingspechot7cmresult
          deftempbpgfdeclarehorizontalshadingtempshading7cm%
          % where 'result' is inserted as last argument:
          expandaftertempbexpandafterresult%
          sboxbackboxpgfuseshadingtempshading%
          begindocument
          begintikzpicture
          beginaxis[set layers,view=900,
          axis lines=left,
          grid=major,
          no marks,
          xmin=0, xmax=1, xlabel=$E$,
          ymin=0, ymax=1, ylabel=$lambda$, ylabel style=rotate=-90
          ]
          addplot+[smooth,blue] 1 - (1 - x)^2; % actual curve
          beginpgfonlayerpre main
          clip plot[variable=x,samples=25,domain=0:1] (x,1 - (1 - x)^2)
          |-cycle;
          node at (0.5,0.5)useboxbackbox;
          endpgfonlayer
          % filling
          endaxis
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • Perfect thank you!

            – Jordan Mackie
            3 hours ago











          • It works , but I do get an error: ! Undefined control sequence. <argument> backbox l.41 sboxbackboxpgfuseshadingtempshading % ?

            – Jordan Mackie
            3 hours ago












          • @JordanMackie Sorry, these statements seem to contradict each other: "it works" and "I get an error". I get this very output from running pdflatex on the above code, of course without error message.

            – marmot
            2 hours ago













          1












          1








          1







          Welcome to TeX-SE! We usually begin our examples with documentclass, end them with enddocument and do not put non-standard characters in the code that prevents others from copying it. The following is an example of an MWE.



          documentclass[tikz,border=3.14mm]standalone 
          usepackagepgfplots
          pgfplotssetcompat=1.16
          newsaveboxbackbox
          pgfplotscolormaptoshadingspechot7cmresult
          deftempbpgfdeclarehorizontalshadingtempshading7cm%
          % where 'result' is inserted as last argument:
          expandaftertempbexpandafterresult%
          sboxbackboxpgfuseshadingtempshading%
          begindocument
          begintikzpicture
          beginaxis[set layers,view=900,
          axis lines=left,
          grid=major,
          no marks,
          xmin=0, xmax=1, xlabel=$E$,
          ymin=0, ymax=1, ylabel=$lambda$, ylabel style=rotate=-90
          ]
          addplot+[smooth,blue] 1 - (1 - x)^2; % actual curve
          beginpgfonlayerpre main
          clip plot[variable=x,samples=25,domain=0:1] (x,1 - (1 - x)^2)
          |-cycle;
          node at (0.5,0.5)useboxbackbox;
          endpgfonlayer
          % filling
          endaxis
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer













          Welcome to TeX-SE! We usually begin our examples with documentclass, end them with enddocument and do not put non-standard characters in the code that prevents others from copying it. The following is an example of an MWE.



          documentclass[tikz,border=3.14mm]standalone 
          usepackagepgfplots
          pgfplotssetcompat=1.16
          newsaveboxbackbox
          pgfplotscolormaptoshadingspechot7cmresult
          deftempbpgfdeclarehorizontalshadingtempshading7cm%
          % where 'result' is inserted as last argument:
          expandaftertempbexpandafterresult%
          sboxbackboxpgfuseshadingtempshading%
          begindocument
          begintikzpicture
          beginaxis[set layers,view=900,
          axis lines=left,
          grid=major,
          no marks,
          xmin=0, xmax=1, xlabel=$E$,
          ymin=0, ymax=1, ylabel=$lambda$, ylabel style=rotate=-90
          ]
          addplot+[smooth,blue] 1 - (1 - x)^2; % actual curve
          beginpgfonlayerpre main
          clip plot[variable=x,samples=25,domain=0:1] (x,1 - (1 - x)^2)
          |-cycle;
          node at (0.5,0.5)useboxbackbox;
          endpgfonlayer
          % filling
          endaxis
          endtikzpicture
          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 3 hours ago









          marmotmarmot

          114k5145276




          114k5145276












          • Perfect thank you!

            – Jordan Mackie
            3 hours ago











          • It works , but I do get an error: ! Undefined control sequence. <argument> backbox l.41 sboxbackboxpgfuseshadingtempshading % ?

            – Jordan Mackie
            3 hours ago












          • @JordanMackie Sorry, these statements seem to contradict each other: "it works" and "I get an error". I get this very output from running pdflatex on the above code, of course without error message.

            – marmot
            2 hours ago

















          • Perfect thank you!

            – Jordan Mackie
            3 hours ago











          • It works , but I do get an error: ! Undefined control sequence. <argument> backbox l.41 sboxbackboxpgfuseshadingtempshading % ?

            – Jordan Mackie
            3 hours ago












          • @JordanMackie Sorry, these statements seem to contradict each other: "it works" and "I get an error". I get this very output from running pdflatex on the above code, of course without error message.

            – marmot
            2 hours ago
















          Perfect thank you!

          – Jordan Mackie
          3 hours ago





          Perfect thank you!

          – Jordan Mackie
          3 hours ago













          It works , but I do get an error: ! Undefined control sequence. <argument> backbox l.41 sboxbackboxpgfuseshadingtempshading % ?

          – Jordan Mackie
          3 hours ago






          It works , but I do get an error: ! Undefined control sequence. <argument> backbox l.41 sboxbackboxpgfuseshadingtempshading % ?

          – Jordan Mackie
          3 hours ago














          @JordanMackie Sorry, these statements seem to contradict each other: "it works" and "I get an error". I get this very output from running pdflatex on the above code, of course without error message.

          – marmot
          2 hours ago





          @JordanMackie Sorry, these statements seem to contradict each other: "it works" and "I get an error". I get this very output from running pdflatex on the above code, of course without error message.

          – marmot
          2 hours ago










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









          draft saved

          draft discarded


















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












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











          Jordan Mackie 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%2f483209%2ffill-area-under-curve-using-colourmap-and-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

          Tender dossier with centered articlesHow can I get legal style indentation on section, subsection, subsubsec.. using titlesec?missing item with addtocontents before sectionsubsubsubsection, paragraph and subparagraph count not reset when starting a new section, subsection, etcTikZ won't support HSB color model hsb in article document classAdding a vskip1em before each section - won't compile with itHow to implement a customized hierarchical table of content using titletoc with changing number formatsSection title formatGrouped entries in index don't spill over to next columnParagraph spacing in documentclassarticle with Figure and ListingsRagged Right Index Entries

          inputenc: Unicode character … not set up for use with LaTeX The Next CEO of Stack OverflowEntering Unicode characters in LaTeXHow to solve the `Package inputenc Error: Unicode char not set up for use with LaTeX` problem?solve “Unicode char is not set up for use with LaTeX” without special handling of every new interesting UTF-8 characterPackage inputenc Error: Unicode character ² (U+B2)(inputenc) not set up for use with LaTeX. acroI2C[I²C]package inputenc error unicode char (u + 190) not set up for use with latexPackage inputenc Error: Unicode char u8:′ not set up for use with LaTeX. 3′inputenc Error: Unicode char u8: not set up for use with LaTeX with G-BriefPackage Inputenc Error: Unicode char u8: not set up for use with LaTeXPackage inputenc Error: Unicode char ́ (U+301)(inputenc) not set up for use with LaTeX. includePackage inputenc Error: Unicode char ̂ (U+302)(inputenc) not set up for use with LaTeX. … $widehatleft (OA,AA' right )$Package inputenc Error: Unicode char â„¡ (U+2121)(inputenc) not set up for use with LaTeX. printbibliography[heading=bibintoc]Package inputenc Error: Unicode char − (U+2212)(inputenc) not set up for use with LaTeXPackage inputenc Error: Unicode character α (U+3B1) not set up for use with LaTeXPackage inputenc Error: Unicode characterError: ! Package inputenc Error: Unicode char ⊘ (U+2298)(inputenc) not set up for use with LaTeX

          acmart: Multiple authors: all with same affiliation, one author an additional affiliationHow to Write Names of Multiple Authors with Shared Affiliation in ACM 2017 Template?Multiple authors with different primary affiliation, but same additional affiliationSame affiliation for all authors without extra packagesIOS-Book-Article.cls: one author with multiple affiliationacmart: Shared Author AffiliationMultiple authors with different primary affiliation, but same additional affiliationAuthor affiliation with only 1 authorAdding Multiple Authors with Different Affiliation in LaTeX ArticleLaTeX: Multiple authors stays on same lineHow to Label Multiple Authors with Same DescriptionHow to make two authors use the same affiliationTwo authors with same affiliation on finished front page