Filling between to draw
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I'm trying to fill an area between to draw lines. I tried a lot of options, but none of them seem to work.
I labeled the areas I need, with the specific colors, to fill. My current Code is:
documentclass[10pt,a4paper,twoside]article
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackageamsmath
usepackageamsfonts
usepackageamssymb
usepackage[centering,includeheadfoot,top=25mm, left=40mm, right=25mm, bottom=30mm]geometry
usepackagefancyhdr
usepackagecolor
usepackagethmbox
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.11
usepgfplotslibraryfillbetween
usetikzlibraryintersections
begindocument
begintikzpicture
fill[color=yellow] (0, 0) circle (2); % Sonne im Ursprung (0, 0)
shade[right color=lightgray] (7.5, 0) circle (0.5); % Sonne im Ursprung (5, 0)
shade[shading=ball, ball color=blue] (10, 0) circle (1); % Erde im Ursprung (10, 0)
draw[dashed, color=red ,shorten >=-1.6cm,shorten <=-0cm,name path = A] (0, 2) --node[near start,sloped,above]textcolorredRandstrahl (7.5, 0.5);
draw[dashed, color=red ,shorten >=-3cm,shorten <=-0cm] (0, 2) -- (7.5, -0.5);
draw[dashed, color=red ,shorten >=-1.6cm,shorten <=-0cm,name path = B] (0, -2) -- (7.5, -0.5);
draw[dashed, color=red ,shorten >=-3cm,shorten <=-0cm] (0, -2) -- (7.5, 0.5);
endtikzpicture
enddocument
As mentioned, I tried a lot of options. So this is, more or less, a desperate attempt for solving my problem.
Thanks for helping me.
tikz-pgf intersections fillbetween fill
New contributor
add a comment |Â
up vote
2
down vote
favorite
I'm trying to fill an area between to draw lines. I tried a lot of options, but none of them seem to work.
I labeled the areas I need, with the specific colors, to fill. My current Code is:
documentclass[10pt,a4paper,twoside]article
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackageamsmath
usepackageamsfonts
usepackageamssymb
usepackage[centering,includeheadfoot,top=25mm, left=40mm, right=25mm, bottom=30mm]geometry
usepackagefancyhdr
usepackagecolor
usepackagethmbox
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.11
usepgfplotslibraryfillbetween
usetikzlibraryintersections
begindocument
begintikzpicture
fill[color=yellow] (0, 0) circle (2); % Sonne im Ursprung (0, 0)
shade[right color=lightgray] (7.5, 0) circle (0.5); % Sonne im Ursprung (5, 0)
shade[shading=ball, ball color=blue] (10, 0) circle (1); % Erde im Ursprung (10, 0)
draw[dashed, color=red ,shorten >=-1.6cm,shorten <=-0cm,name path = A] (0, 2) --node[near start,sloped,above]textcolorredRandstrahl (7.5, 0.5);
draw[dashed, color=red ,shorten >=-3cm,shorten <=-0cm] (0, 2) -- (7.5, -0.5);
draw[dashed, color=red ,shorten >=-1.6cm,shorten <=-0cm,name path = B] (0, -2) -- (7.5, -0.5);
draw[dashed, color=red ,shorten >=-3cm,shorten <=-0cm] (0, -2) -- (7.5, 0.5);
endtikzpicture
enddocument
As mentioned, I tried a lot of options. So this is, more or less, a desperate attempt for solving my problem.
Thanks for helping me.
tikz-pgf intersections fillbetween fill
New contributor
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm trying to fill an area between to draw lines. I tried a lot of options, but none of them seem to work.
I labeled the areas I need, with the specific colors, to fill. My current Code is:
documentclass[10pt,a4paper,twoside]article
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackageamsmath
usepackageamsfonts
usepackageamssymb
usepackage[centering,includeheadfoot,top=25mm, left=40mm, right=25mm, bottom=30mm]geometry
usepackagefancyhdr
usepackagecolor
usepackagethmbox
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.11
usepgfplotslibraryfillbetween
usetikzlibraryintersections
begindocument
begintikzpicture
fill[color=yellow] (0, 0) circle (2); % Sonne im Ursprung (0, 0)
shade[right color=lightgray] (7.5, 0) circle (0.5); % Sonne im Ursprung (5, 0)
shade[shading=ball, ball color=blue] (10, 0) circle (1); % Erde im Ursprung (10, 0)
draw[dashed, color=red ,shorten >=-1.6cm,shorten <=-0cm,name path = A] (0, 2) --node[near start,sloped,above]textcolorredRandstrahl (7.5, 0.5);
draw[dashed, color=red ,shorten >=-3cm,shorten <=-0cm] (0, 2) -- (7.5, -0.5);
draw[dashed, color=red ,shorten >=-1.6cm,shorten <=-0cm,name path = B] (0, -2) -- (7.5, -0.5);
draw[dashed, color=red ,shorten >=-3cm,shorten <=-0cm] (0, -2) -- (7.5, 0.5);
endtikzpicture
enddocument
As mentioned, I tried a lot of options. So this is, more or less, a desperate attempt for solving my problem.
Thanks for helping me.
tikz-pgf intersections fillbetween fill
New contributor
I'm trying to fill an area between to draw lines. I tried a lot of options, but none of them seem to work.
I labeled the areas I need, with the specific colors, to fill. My current Code is:
documentclass[10pt,a4paper,twoside]article
usepackage[utf8]inputenc
usepackage[ngerman]babel
usepackageamsmath
usepackageamsfonts
usepackageamssymb
usepackage[centering,includeheadfoot,top=25mm, left=40mm, right=25mm, bottom=30mm]geometry
usepackagefancyhdr
usepackagecolor
usepackagethmbox
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.11
usepgfplotslibraryfillbetween
usetikzlibraryintersections
begindocument
begintikzpicture
fill[color=yellow] (0, 0) circle (2); % Sonne im Ursprung (0, 0)
shade[right color=lightgray] (7.5, 0) circle (0.5); % Sonne im Ursprung (5, 0)
shade[shading=ball, ball color=blue] (10, 0) circle (1); % Erde im Ursprung (10, 0)
draw[dashed, color=red ,shorten >=-1.6cm,shorten <=-0cm,name path = A] (0, 2) --node[near start,sloped,above]textcolorredRandstrahl (7.5, 0.5);
draw[dashed, color=red ,shorten >=-3cm,shorten <=-0cm] (0, 2) -- (7.5, -0.5);
draw[dashed, color=red ,shorten >=-1.6cm,shorten <=-0cm,name path = B] (0, -2) -- (7.5, -0.5);
draw[dashed, color=red ,shorten >=-3cm,shorten <=-0cm] (0, -2) -- (7.5, 0.5);
endtikzpicture
enddocument
As mentioned, I tried a lot of options. So this is, more or less, a desperate attempt for solving my problem.
Thanks for helping me.
tikz-pgf intersections fillbetween fill
tikz-pgf intersections fillbetween fill
New contributor
New contributor
edited 46 mins ago
ferahfeza
5,11411830
5,11411830
New contributor
asked 53 mins ago
DonFangzahn
111
111
New contributor
New contributor
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
Welcome to TeX.SE! The reason why you really fill the regions between the paths in your picture is that you used shorten >=...
with some negative dimensions. Hence the paths are shorter than the dashed lines. I fixed that to make it work. And even though you could do that with the pgfplots library fillbetween
, this is not necessary here since you only have straight lines. And I used backgrounds
and slightly changed the order in which things get drawn in order not to overwrite your planets.
documentclass[10pt,a4paper,twoside]article
usepackage[utf8]inputenc
usepackagetikz
usetikzlibraryintersections,backgrounds
begindocument
begintikzpicture
fill[color=yellow] (0, 0) circle (2); % Sonne im Ursprung (0, 0)
shade[right color=lightgray] (7.5, 0) circle (0.5); % Sonne im Ursprung (5, 0)
draw[dashed, color=red,name path = A] (0, 2) --
node[near start,sloped,above]textcolorredRandstrahl (10, 0)
coordinate (X1);
draw[dashed, color=red ,name path = C] (0, 2) --
(10, -1.33)
coordinate (X2);
draw[dashed, color=red ,name path = B] (0, -2) -- (10, 0)
coordinate (X3);
draw[dashed, color=red ,name path = D] (0, -2) -- (10, 1.33)
coordinate (X4);
beginscope[on background layer]
fill[gray,
name intersections=of=A and D,by=X5] (X3) -- (X5) -- (X4);
fill[gray,
name intersections=of=C and B,by=X6] (X1) -- (X6) -- (X2);
fill[black] (X6) -- (X3) -- (X5);
endscope
shade[shading=ball, ball color=blue] (10, 0) circle (1); % Erde im Ursprung (10, 0)
endtikzpicture
enddocument
From the bottom of my heart, thank you, a lot. This solved my problem.
â DonFangzahn
7 mins ago
@DonFangzahn Glad to hear! BTW, if you are satisfied with a given answer, you may consider accepting it by clicking on the check mark left of it.
â marmot
4 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Welcome to TeX.SE! The reason why you really fill the regions between the paths in your picture is that you used shorten >=...
with some negative dimensions. Hence the paths are shorter than the dashed lines. I fixed that to make it work. And even though you could do that with the pgfplots library fillbetween
, this is not necessary here since you only have straight lines. And I used backgrounds
and slightly changed the order in which things get drawn in order not to overwrite your planets.
documentclass[10pt,a4paper,twoside]article
usepackage[utf8]inputenc
usepackagetikz
usetikzlibraryintersections,backgrounds
begindocument
begintikzpicture
fill[color=yellow] (0, 0) circle (2); % Sonne im Ursprung (0, 0)
shade[right color=lightgray] (7.5, 0) circle (0.5); % Sonne im Ursprung (5, 0)
draw[dashed, color=red,name path = A] (0, 2) --
node[near start,sloped,above]textcolorredRandstrahl (10, 0)
coordinate (X1);
draw[dashed, color=red ,name path = C] (0, 2) --
(10, -1.33)
coordinate (X2);
draw[dashed, color=red ,name path = B] (0, -2) -- (10, 0)
coordinate (X3);
draw[dashed, color=red ,name path = D] (0, -2) -- (10, 1.33)
coordinate (X4);
beginscope[on background layer]
fill[gray,
name intersections=of=A and D,by=X5] (X3) -- (X5) -- (X4);
fill[gray,
name intersections=of=C and B,by=X6] (X1) -- (X6) -- (X2);
fill[black] (X6) -- (X3) -- (X5);
endscope
shade[shading=ball, ball color=blue] (10, 0) circle (1); % Erde im Ursprung (10, 0)
endtikzpicture
enddocument
From the bottom of my heart, thank you, a lot. This solved my problem.
â DonFangzahn
7 mins ago
@DonFangzahn Glad to hear! BTW, if you are satisfied with a given answer, you may consider accepting it by clicking on the check mark left of it.
â marmot
4 mins ago
add a comment |Â
up vote
3
down vote
Welcome to TeX.SE! The reason why you really fill the regions between the paths in your picture is that you used shorten >=...
with some negative dimensions. Hence the paths are shorter than the dashed lines. I fixed that to make it work. And even though you could do that with the pgfplots library fillbetween
, this is not necessary here since you only have straight lines. And I used backgrounds
and slightly changed the order in which things get drawn in order not to overwrite your planets.
documentclass[10pt,a4paper,twoside]article
usepackage[utf8]inputenc
usepackagetikz
usetikzlibraryintersections,backgrounds
begindocument
begintikzpicture
fill[color=yellow] (0, 0) circle (2); % Sonne im Ursprung (0, 0)
shade[right color=lightgray] (7.5, 0) circle (0.5); % Sonne im Ursprung (5, 0)
draw[dashed, color=red,name path = A] (0, 2) --
node[near start,sloped,above]textcolorredRandstrahl (10, 0)
coordinate (X1);
draw[dashed, color=red ,name path = C] (0, 2) --
(10, -1.33)
coordinate (X2);
draw[dashed, color=red ,name path = B] (0, -2) -- (10, 0)
coordinate (X3);
draw[dashed, color=red ,name path = D] (0, -2) -- (10, 1.33)
coordinate (X4);
beginscope[on background layer]
fill[gray,
name intersections=of=A and D,by=X5] (X3) -- (X5) -- (X4);
fill[gray,
name intersections=of=C and B,by=X6] (X1) -- (X6) -- (X2);
fill[black] (X6) -- (X3) -- (X5);
endscope
shade[shading=ball, ball color=blue] (10, 0) circle (1); % Erde im Ursprung (10, 0)
endtikzpicture
enddocument
From the bottom of my heart, thank you, a lot. This solved my problem.
â DonFangzahn
7 mins ago
@DonFangzahn Glad to hear! BTW, if you are satisfied with a given answer, you may consider accepting it by clicking on the check mark left of it.
â marmot
4 mins ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Welcome to TeX.SE! The reason why you really fill the regions between the paths in your picture is that you used shorten >=...
with some negative dimensions. Hence the paths are shorter than the dashed lines. I fixed that to make it work. And even though you could do that with the pgfplots library fillbetween
, this is not necessary here since you only have straight lines. And I used backgrounds
and slightly changed the order in which things get drawn in order not to overwrite your planets.
documentclass[10pt,a4paper,twoside]article
usepackage[utf8]inputenc
usepackagetikz
usetikzlibraryintersections,backgrounds
begindocument
begintikzpicture
fill[color=yellow] (0, 0) circle (2); % Sonne im Ursprung (0, 0)
shade[right color=lightgray] (7.5, 0) circle (0.5); % Sonne im Ursprung (5, 0)
draw[dashed, color=red,name path = A] (0, 2) --
node[near start,sloped,above]textcolorredRandstrahl (10, 0)
coordinate (X1);
draw[dashed, color=red ,name path = C] (0, 2) --
(10, -1.33)
coordinate (X2);
draw[dashed, color=red ,name path = B] (0, -2) -- (10, 0)
coordinate (X3);
draw[dashed, color=red ,name path = D] (0, -2) -- (10, 1.33)
coordinate (X4);
beginscope[on background layer]
fill[gray,
name intersections=of=A and D,by=X5] (X3) -- (X5) -- (X4);
fill[gray,
name intersections=of=C and B,by=X6] (X1) -- (X6) -- (X2);
fill[black] (X6) -- (X3) -- (X5);
endscope
shade[shading=ball, ball color=blue] (10, 0) circle (1); % Erde im Ursprung (10, 0)
endtikzpicture
enddocument
Welcome to TeX.SE! The reason why you really fill the regions between the paths in your picture is that you used shorten >=...
with some negative dimensions. Hence the paths are shorter than the dashed lines. I fixed that to make it work. And even though you could do that with the pgfplots library fillbetween
, this is not necessary here since you only have straight lines. And I used backgrounds
and slightly changed the order in which things get drawn in order not to overwrite your planets.
documentclass[10pt,a4paper,twoside]article
usepackage[utf8]inputenc
usepackagetikz
usetikzlibraryintersections,backgrounds
begindocument
begintikzpicture
fill[color=yellow] (0, 0) circle (2); % Sonne im Ursprung (0, 0)
shade[right color=lightgray] (7.5, 0) circle (0.5); % Sonne im Ursprung (5, 0)
draw[dashed, color=red,name path = A] (0, 2) --
node[near start,sloped,above]textcolorredRandstrahl (10, 0)
coordinate (X1);
draw[dashed, color=red ,name path = C] (0, 2) --
(10, -1.33)
coordinate (X2);
draw[dashed, color=red ,name path = B] (0, -2) -- (10, 0)
coordinate (X3);
draw[dashed, color=red ,name path = D] (0, -2) -- (10, 1.33)
coordinate (X4);
beginscope[on background layer]
fill[gray,
name intersections=of=A and D,by=X5] (X3) -- (X5) -- (X4);
fill[gray,
name intersections=of=C and B,by=X6] (X1) -- (X6) -- (X2);
fill[black] (X6) -- (X3) -- (X5);
endscope
shade[shading=ball, ball color=blue] (10, 0) circle (1); % Erde im Ursprung (10, 0)
endtikzpicture
enddocument
answered 15 mins ago
marmot
61.4k465133
61.4k465133
From the bottom of my heart, thank you, a lot. This solved my problem.
â DonFangzahn
7 mins ago
@DonFangzahn Glad to hear! BTW, if you are satisfied with a given answer, you may consider accepting it by clicking on the check mark left of it.
â marmot
4 mins ago
add a comment |Â
From the bottom of my heart, thank you, a lot. This solved my problem.
â DonFangzahn
7 mins ago
@DonFangzahn Glad to hear! BTW, if you are satisfied with a given answer, you may consider accepting it by clicking on the check mark left of it.
â marmot
4 mins ago
From the bottom of my heart, thank you, a lot. This solved my problem.
â DonFangzahn
7 mins ago
From the bottom of my heart, thank you, a lot. This solved my problem.
â DonFangzahn
7 mins ago
@DonFangzahn Glad to hear! BTW, if you are satisfied with a given answer, you may consider accepting it by clicking on the check mark left of it.
â marmot
4 mins ago
@DonFangzahn Glad to hear! BTW, if you are satisfied with a given answer, you may consider accepting it by clicking on the check mark left of it.
â marmot
4 mins ago
add a comment |Â
DonFangzahn is a new contributor. Be nice, and check out our Code of Conduct.
DonFangzahn is a new contributor. Be nice, and check out our Code of Conduct.
DonFangzahn is a new contributor. Be nice, and check out our Code of Conduct.
DonFangzahn is a new contributor. Be nice, and check out our Code of Conduct.
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%2f453191%2ffilling-between-to-draw%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