Fill color between two coordinates
Clash 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
fillbetween tikz-pg
add a comment |Â
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
fillbetween tikz-pg
add a comment |Â
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
fillbetween tikz-pg
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
fillbetween tikz-pg
edited 57 mins ago


CarLaTeX
26.4k444116
26.4k444116
asked 1 hour ago
snehal
568614
568614
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
like this?
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
add a comment |Â
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 bytikz
) - the
scriptsize
environment within thetikzpicture
does nothing, use the optionscale=...
, 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
Yes, it looks a lot like code generated bygeogebra
that has been partially cleaned up. geogebra.org
– AndréC
7 mins ago
add a comment |Â
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?
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
add a comment |Â
up vote
1
down vote
like this?
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
add a comment |Â
up vote
1
down vote
up vote
1
down vote
like this?
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
like this?
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
answered 27 mins ago
AndréC
4,5721834
4,5721834
add a comment |Â
add a comment |Â
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 bytikz
) - the
scriptsize
environment within thetikzpicture
does nothing, use the optionscale=...
, 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
Yes, it looks a lot like code generated bygeogebra
that has been partially cleaned up. geogebra.org
– AndréC
7 mins ago
add a comment |Â
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 bytikz
) - the
scriptsize
environment within thetikzpicture
does nothing, use the optionscale=...
, 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
Yes, it looks a lot like code generated bygeogebra
that has been partially cleaned up. geogebra.org
– AndréC
7 mins ago
add a comment |Â
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 bytikz
) - the
scriptsize
environment within thetikzpicture
does nothing, use the optionscale=...
, 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
Another possibility is tikzfillbetween
but does your code come from some automatic tool?
Because:
- you uselessly loaded
pgf
(it is already loaded bytikz
) - the
scriptsize
environment within thetikzpicture
does nothing, use the optionscale=...
, 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
answered 11 mins ago


CarLaTeX
26.4k444116
26.4k444116
Yes, it looks a lot like code generated bygeogebra
that has been partially cleaned up. geogebra.org
– AndréC
7 mins ago
add a comment |Â
Yes, it looks a lot like code generated bygeogebra
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password