Fill color between two coordinates

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












Question: How can I fill the region between O(0,0) and A(1,1)?



This is what I've done so far:



documentclass[12pt]article
usepackagepgf,tikz,pgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usetikzlibraryarrows
usepgfplotslibraryfillbetween
pagestyleempty
begindocument
definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
begincenter
begintikzpicture[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
beginaxis[
x=2.5cm,y=2.5cm,
axis lines=middle,
axis line style=stealth-stealth,
xmin=-3,
xmax=3,
ymin=-3,
ymax=3,
xtick=-2,...,2,
ytick=-2,...,2,]
draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2/2.0/0.5);
draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->] plot(x,(-0--1*x)/1);
beginscriptsize
draw[color=black] (-1.5,2.5) node $y=x^2$;
draw[color=black] (-1.5,-2) node $y=x$;
draw [fill=black] (0,0) circle (1.8pt);
draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
draw [fill=black] (1,1) circle (1.8pt);
draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
endscriptsize
endaxis
endtikzpicture
endcenter
enddocument









share|improve this question



























    up vote
    2
    down vote

    favorite












    Question: How can I fill the region between O(0,0) and A(1,1)?



    This is what I've done so far:



    documentclass[12pt]article
    usepackagepgf,tikz,pgfplots
    pgfplotssetcompat=1.15
    usepackagemathrsfs
    usetikzlibraryarrows
    usepgfplotslibraryfillbetween
    pagestyleempty
    begindocument
    definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
    definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
    begincenter
    begintikzpicture[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
    beginaxis[
    x=2.5cm,y=2.5cm,
    axis lines=middle,
    axis line style=stealth-stealth,
    xmin=-3,
    xmax=3,
    ymin=-3,
    ymax=3,
    xtick=-2,...,2,
    ytick=-2,...,2,]
    draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2/2.0/0.5);
    draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->] plot(x,(-0--1*x)/1);
    beginscriptsize
    draw[color=black] (-1.5,2.5) node $y=x^2$;
    draw[color=black] (-1.5,-2) node $y=x$;
    draw [fill=black] (0,0) circle (1.8pt);
    draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
    draw [fill=black] (1,1) circle (1.8pt);
    draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
    endscriptsize
    endaxis
    endtikzpicture
    endcenter
    enddocument









    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Question: How can I fill the region between O(0,0) and A(1,1)?



      This is what I've done so far:



      documentclass[12pt]article
      usepackagepgf,tikz,pgfplots
      pgfplotssetcompat=1.15
      usepackagemathrsfs
      usetikzlibraryarrows
      usepgfplotslibraryfillbetween
      pagestyleempty
      begindocument
      definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
      definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
      begincenter
      begintikzpicture[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
      beginaxis[
      x=2.5cm,y=2.5cm,
      axis lines=middle,
      axis line style=stealth-stealth,
      xmin=-3,
      xmax=3,
      ymin=-3,
      ymax=3,
      xtick=-2,...,2,
      ytick=-2,...,2,]
      draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2/2.0/0.5);
      draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->] plot(x,(-0--1*x)/1);
      beginscriptsize
      draw[color=black] (-1.5,2.5) node $y=x^2$;
      draw[color=black] (-1.5,-2) node $y=x$;
      draw [fill=black] (0,0) circle (1.8pt);
      draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
      draw [fill=black] (1,1) circle (1.8pt);
      draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
      endscriptsize
      endaxis
      endtikzpicture
      endcenter
      enddocument









      share|improve this question















      Question: How can I fill the region between O(0,0) and A(1,1)?



      This is what I've done so far:



      documentclass[12pt]article
      usepackagepgf,tikz,pgfplots
      pgfplotssetcompat=1.15
      usepackagemathrsfs
      usetikzlibraryarrows
      usepgfplotslibraryfillbetween
      pagestyleempty
      begindocument
      definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
      definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
      begincenter
      begintikzpicture[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
      beginaxis[
      x=2.5cm,y=2.5cm,
      axis lines=middle,
      axis line style=stealth-stealth,
      xmin=-3,
      xmax=3,
      ymin=-3,
      ymax=3,
      xtick=-2,...,2,
      ytick=-2,...,2,]
      draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2/2.0/0.5);
      draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->] plot(x,(-0--1*x)/1);
      beginscriptsize
      draw[color=black] (-1.5,2.5) node $y=x^2$;
      draw[color=black] (-1.5,-2) node $y=x$;
      draw [fill=black] (0,0) circle (1.8pt);
      draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
      draw [fill=black] (1,1) circle (1.8pt);
      draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
      endscriptsize
      endaxis
      endtikzpicture
      endcenter
      enddocument






      fillbetween tikz-pg






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 57 mins ago









      CarLaTeX

      26.4k444116




      26.4k444116










      asked 1 hour ago









      snehal

      568614




      568614




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          like this?



          plot



          documentclass[12pt]article
          usepackagepgf,tikz,pgfplots
          pgfplotssetcompat=1.15
          usepackagemathrsfs
          usetikzlibraryarrows
          usepgfplotslibraryfillbetween
          pagestyleempty
          begindocument
          definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
          definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
          begincenter
          begintikzpicture[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
          beginaxis[
          x=2.5cm,y=2.5cm,
          axis lines=middle,
          axis line style=stealth-stealth,
          xmin=-3,
          xmax=3,
          ymin=-3,
          ymax=3,
          xtick=-2,...,2,
          ytick=-2,...,2,]
          draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2/2.0/0.5);
          draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->,name path=C2] plot(x,(-0--1*x)/1);
          plot [orange] fill between [of=C1 and C2,soft clip=(0,0) rectangle(1,1)];
          beginscriptsize
          draw[color=black] (-1.5,2.5) node $y=x^2$;
          draw[color=black] (-1.5,-2) node $y=x$;
          draw [fill=black] (0,0) circle (1.8pt);
          draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
          draw [fill=black] (1,1) circle (1.8pt);
          draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
          endscriptsize
          endaxis
          endtikzpicture
          endcenter
          enddocument





          share|improve this answer



























            up vote
            1
            down vote













            Another possibility is tikzfillbetween but does your code come from some automatic tool?



            Because:



            • you uselessly loaded pgf (it is already loaded by tikz)

            • the scriptsize environment within the tikzpicture does nothing, use the option scale=..., instead

            • the formulae of your line and your parabola are uselessly complicated (I've changed them)

            • your color definitions are strange.



            documentclass[12pt]article
            usepackagetikz,pgfplots
            pgfplotssetcompat=1.15
            usepackagemathrsfs
            usetikzlibraryarrows
            usepgfplotslibraryfillbetween
            pagestyleempty
            begindocument
            definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
            definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
            begincenter
            begintikzpicture[line cap=round,line join=round,>=triangle 45, scale=.9]
            beginaxis[
            x=2.5cm,y=2.5cm,
            axis lines=middle,
            axis line style=stealth-stealth,
            xmin=-3,
            xmax=3,
            ymin=-3,
            ymax=3,
            xtick=-2,...,2,
            ytick=-2,...,2,]
            draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2);
            draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->, name path=retta] plot(x,x);
            draw[color=black] (-1.5,2.5) node $y=x^2$;
            draw[color=black] (-1.5,-2) node $y=x$;
            draw [fill=black] (0,0) circle (1.8pt);
            draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
            draw [fill=black] (1,1) circle (1.8pt);
            draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
            tikzfillbetween[
            of=C1 and retta,
            soft clip=domain=0:1
            ] red;
            endaxis
            endtikzpicture
            endcenter
            enddocument


            enter image description here






            share|improve this answer




















            • Yes, it looks a lot like code generated by geogebra that has been partially cleaned up. geogebra.org
              – AndréC
              7 mins 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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f457290%2ffill-color-between-two-coordinates%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            like this?



            plot



            documentclass[12pt]article
            usepackagepgf,tikz,pgfplots
            pgfplotssetcompat=1.15
            usepackagemathrsfs
            usetikzlibraryarrows
            usepgfplotslibraryfillbetween
            pagestyleempty
            begindocument
            definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
            definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
            begincenter
            begintikzpicture[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
            beginaxis[
            x=2.5cm,y=2.5cm,
            axis lines=middle,
            axis line style=stealth-stealth,
            xmin=-3,
            xmax=3,
            ymin=-3,
            ymax=3,
            xtick=-2,...,2,
            ytick=-2,...,2,]
            draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2/2.0/0.5);
            draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->,name path=C2] plot(x,(-0--1*x)/1);
            plot [orange] fill between [of=C1 and C2,soft clip=(0,0) rectangle(1,1)];
            beginscriptsize
            draw[color=black] (-1.5,2.5) node $y=x^2$;
            draw[color=black] (-1.5,-2) node $y=x$;
            draw [fill=black] (0,0) circle (1.8pt);
            draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
            draw [fill=black] (1,1) circle (1.8pt);
            draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
            endscriptsize
            endaxis
            endtikzpicture
            endcenter
            enddocument





            share|improve this answer
























              up vote
              1
              down vote













              like this?



              plot



              documentclass[12pt]article
              usepackagepgf,tikz,pgfplots
              pgfplotssetcompat=1.15
              usepackagemathrsfs
              usetikzlibraryarrows
              usepgfplotslibraryfillbetween
              pagestyleempty
              begindocument
              definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
              definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
              begincenter
              begintikzpicture[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
              beginaxis[
              x=2.5cm,y=2.5cm,
              axis lines=middle,
              axis line style=stealth-stealth,
              xmin=-3,
              xmax=3,
              ymin=-3,
              ymax=3,
              xtick=-2,...,2,
              ytick=-2,...,2,]
              draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2/2.0/0.5);
              draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->,name path=C2] plot(x,(-0--1*x)/1);
              plot [orange] fill between [of=C1 and C2,soft clip=(0,0) rectangle(1,1)];
              beginscriptsize
              draw[color=black] (-1.5,2.5) node $y=x^2$;
              draw[color=black] (-1.5,-2) node $y=x$;
              draw [fill=black] (0,0) circle (1.8pt);
              draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
              draw [fill=black] (1,1) circle (1.8pt);
              draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
              endscriptsize
              endaxis
              endtikzpicture
              endcenter
              enddocument





              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                like this?



                plot



                documentclass[12pt]article
                usepackagepgf,tikz,pgfplots
                pgfplotssetcompat=1.15
                usepackagemathrsfs
                usetikzlibraryarrows
                usepgfplotslibraryfillbetween
                pagestyleempty
                begindocument
                definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
                definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
                begincenter
                begintikzpicture[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
                beginaxis[
                x=2.5cm,y=2.5cm,
                axis lines=middle,
                axis line style=stealth-stealth,
                xmin=-3,
                xmax=3,
                ymin=-3,
                ymax=3,
                xtick=-2,...,2,
                ytick=-2,...,2,]
                draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2/2.0/0.5);
                draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->,name path=C2] plot(x,(-0--1*x)/1);
                plot [orange] fill between [of=C1 and C2,soft clip=(0,0) rectangle(1,1)];
                beginscriptsize
                draw[color=black] (-1.5,2.5) node $y=x^2$;
                draw[color=black] (-1.5,-2) node $y=x$;
                draw [fill=black] (0,0) circle (1.8pt);
                draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
                draw [fill=black] (1,1) circle (1.8pt);
                draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
                endscriptsize
                endaxis
                endtikzpicture
                endcenter
                enddocument





                share|improve this answer












                like this?



                plot



                documentclass[12pt]article
                usepackagepgf,tikz,pgfplots
                pgfplotssetcompat=1.15
                usepackagemathrsfs
                usetikzlibraryarrows
                usepgfplotslibraryfillbetween
                pagestyleempty
                begindocument
                definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
                definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
                begincenter
                begintikzpicture[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
                beginaxis[
                x=2.5cm,y=2.5cm,
                axis lines=middle,
                axis line style=stealth-stealth,
                xmin=-3,
                xmax=3,
                ymin=-3,
                ymax=3,
                xtick=-2,...,2,
                ytick=-2,...,2,]
                draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2/2.0/0.5);
                draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->,name path=C2] plot(x,(-0--1*x)/1);
                plot [orange] fill between [of=C1 and C2,soft clip=(0,0) rectangle(1,1)];
                beginscriptsize
                draw[color=black] (-1.5,2.5) node $y=x^2$;
                draw[color=black] (-1.5,-2) node $y=x$;
                draw [fill=black] (0,0) circle (1.8pt);
                draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
                draw [fill=black] (1,1) circle (1.8pt);
                draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
                endscriptsize
                endaxis
                endtikzpicture
                endcenter
                enddocument






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 27 mins ago









                AndréC

                4,5721834




                4,5721834




















                    up vote
                    1
                    down vote













                    Another possibility is tikzfillbetween but does your code come from some automatic tool?



                    Because:



                    • you uselessly loaded pgf (it is already loaded by tikz)

                    • the scriptsize environment within the tikzpicture does nothing, use the option scale=..., instead

                    • the formulae of your line and your parabola are uselessly complicated (I've changed them)

                    • your color definitions are strange.



                    documentclass[12pt]article
                    usepackagetikz,pgfplots
                    pgfplotssetcompat=1.15
                    usepackagemathrsfs
                    usetikzlibraryarrows
                    usepgfplotslibraryfillbetween
                    pagestyleempty
                    begindocument
                    definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
                    definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
                    begincenter
                    begintikzpicture[line cap=round,line join=round,>=triangle 45, scale=.9]
                    beginaxis[
                    x=2.5cm,y=2.5cm,
                    axis lines=middle,
                    axis line style=stealth-stealth,
                    xmin=-3,
                    xmax=3,
                    ymin=-3,
                    ymax=3,
                    xtick=-2,...,2,
                    ytick=-2,...,2,]
                    draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2);
                    draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->, name path=retta] plot(x,x);
                    draw[color=black] (-1.5,2.5) node $y=x^2$;
                    draw[color=black] (-1.5,-2) node $y=x$;
                    draw [fill=black] (0,0) circle (1.8pt);
                    draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
                    draw [fill=black] (1,1) circle (1.8pt);
                    draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
                    tikzfillbetween[
                    of=C1 and retta,
                    soft clip=domain=0:1
                    ] red;
                    endaxis
                    endtikzpicture
                    endcenter
                    enddocument


                    enter image description here






                    share|improve this answer




















                    • Yes, it looks a lot like code generated by geogebra that has been partially cleaned up. geogebra.org
                      – AndréC
                      7 mins ago














                    up vote
                    1
                    down vote













                    Another possibility is tikzfillbetween but does your code come from some automatic tool?



                    Because:



                    • you uselessly loaded pgf (it is already loaded by tikz)

                    • the scriptsize environment within the tikzpicture does nothing, use the option scale=..., instead

                    • the formulae of your line and your parabola are uselessly complicated (I've changed them)

                    • your color definitions are strange.



                    documentclass[12pt]article
                    usepackagetikz,pgfplots
                    pgfplotssetcompat=1.15
                    usepackagemathrsfs
                    usetikzlibraryarrows
                    usepgfplotslibraryfillbetween
                    pagestyleempty
                    begindocument
                    definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
                    definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
                    begincenter
                    begintikzpicture[line cap=round,line join=round,>=triangle 45, scale=.9]
                    beginaxis[
                    x=2.5cm,y=2.5cm,
                    axis lines=middle,
                    axis line style=stealth-stealth,
                    xmin=-3,
                    xmax=3,
                    ymin=-3,
                    ymax=3,
                    xtick=-2,...,2,
                    ytick=-2,...,2,]
                    draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2);
                    draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->, name path=retta] plot(x,x);
                    draw[color=black] (-1.5,2.5) node $y=x^2$;
                    draw[color=black] (-1.5,-2) node $y=x$;
                    draw [fill=black] (0,0) circle (1.8pt);
                    draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
                    draw [fill=black] (1,1) circle (1.8pt);
                    draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
                    tikzfillbetween[
                    of=C1 and retta,
                    soft clip=domain=0:1
                    ] red;
                    endaxis
                    endtikzpicture
                    endcenter
                    enddocument


                    enter image description here






                    share|improve this answer




















                    • Yes, it looks a lot like code generated by geogebra that has been partially cleaned up. geogebra.org
                      – AndréC
                      7 mins ago












                    up vote
                    1
                    down vote










                    up vote
                    1
                    down vote









                    Another possibility is tikzfillbetween but does your code come from some automatic tool?



                    Because:



                    • you uselessly loaded pgf (it is already loaded by tikz)

                    • the scriptsize environment within the tikzpicture does nothing, use the option scale=..., instead

                    • the formulae of your line and your parabola are uselessly complicated (I've changed them)

                    • your color definitions are strange.



                    documentclass[12pt]article
                    usepackagetikz,pgfplots
                    pgfplotssetcompat=1.15
                    usepackagemathrsfs
                    usetikzlibraryarrows
                    usepgfplotslibraryfillbetween
                    pagestyleempty
                    begindocument
                    definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
                    definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
                    begincenter
                    begintikzpicture[line cap=round,line join=round,>=triangle 45, scale=.9]
                    beginaxis[
                    x=2.5cm,y=2.5cm,
                    axis lines=middle,
                    axis line style=stealth-stealth,
                    xmin=-3,
                    xmax=3,
                    ymin=-3,
                    ymax=3,
                    xtick=-2,...,2,
                    ytick=-2,...,2,]
                    draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2);
                    draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->, name path=retta] plot(x,x);
                    draw[color=black] (-1.5,2.5) node $y=x^2$;
                    draw[color=black] (-1.5,-2) node $y=x$;
                    draw [fill=black] (0,0) circle (1.8pt);
                    draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
                    draw [fill=black] (1,1) circle (1.8pt);
                    draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
                    tikzfillbetween[
                    of=C1 and retta,
                    soft clip=domain=0:1
                    ] red;
                    endaxis
                    endtikzpicture
                    endcenter
                    enddocument


                    enter image description here






                    share|improve this answer












                    Another possibility is tikzfillbetween but does your code come from some automatic tool?



                    Because:



                    • you uselessly loaded pgf (it is already loaded by tikz)

                    • the scriptsize environment within the tikzpicture does nothing, use the option scale=..., instead

                    • the formulae of your line and your parabola are uselessly complicated (I've changed them)

                    • your color definitions are strange.



                    documentclass[12pt]article
                    usepackagetikz,pgfplots
                    pgfplotssetcompat=1.15
                    usepackagemathrsfs
                    usetikzlibraryarrows
                    usepgfplotslibraryfillbetween
                    pagestyleempty
                    begindocument
                    definecolorsexdtsrgb0.1803921568627451,0.49019607843137253,0.19607843137254902
                    definecolorwrwrwrrgb0.3803921568627451,0.3803921568627451,0.3803921568627451
                    begincenter
                    begintikzpicture[line cap=round,line join=round,>=triangle 45, scale=.9]
                    beginaxis[
                    x=2.5cm,y=2.5cm,
                    axis lines=middle,
                    axis line style=stealth-stealth,
                    xmin=-3,
                    xmax=3,
                    ymin=-3,
                    ymax=3,
                    xtick=-2,...,2,
                    ytick=-2,...,2,]
                    draw [samples=50,rotate around=0:(0,0),xshift=0cm,yshift=0cm,line width=0.8pt,color=wrwrwr,domain=-1.5:1.5,<->,name path=C1] plot (x,(x)^2);
                    draw [line width=0.8pt,color=sexdts,domain=-2.0:2,<->, name path=retta] plot(x,x);
                    draw[color=black] (-1.5,2.5) node $y=x^2$;
                    draw[color=black] (-1.5,-2) node $y=x$;
                    draw [fill=black] (0,0) circle (1.8pt);
                    draw[color=black] (0.40,-0.25) node [rotate=00]O(0 , 0);
                    draw [fill=black] (1,1) circle (1.8pt);
                    draw[color=black] (1.40,1.00) node [rotate=00]A(1 , 1);
                    tikzfillbetween[
                    of=C1 and retta,
                    soft clip=domain=0:1
                    ] red;
                    endaxis
                    endtikzpicture
                    endcenter
                    enddocument


                    enter image description here







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 11 mins ago









                    CarLaTeX

                    26.4k444116




                    26.4k444116











                    • Yes, it looks a lot like code generated by geogebra that has been partially cleaned up. geogebra.org
                      – AndréC
                      7 mins ago
















                    • Yes, it looks a lot like code generated by geogebra that has been partially cleaned up. geogebra.org
                      – AndréC
                      7 mins ago















                    Yes, it looks a lot like code generated by geogebra that has been partially cleaned up. geogebra.org
                    – AndréC
                    7 mins ago




                    Yes, it looks a lot like code generated by geogebra that has been partially cleaned up. geogebra.org
                    – AndréC
                    7 mins ago

















                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f457290%2ffill-color-between-two-coordinates%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    List of Gilmore Girls characters

                    What does second last employer means? [closed]

                    One-line joke