How to shade a polygon with curved lines in tikz?Rotate a node but not its content: the case of the ellipse decorationAbsolutely position arrow headUML StatediagramHow to define the default vertical distance between nodes?pgfplots markers and lines on different layersNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themProblems with nested TikZpictures
On the relation between the asymptotics of a Dirichlet series' coefficients and the series' analytic continuability
Playing a fast but quiet Alberti bass
Is there a commercial liquid with refractive index greater than n=2?
Best model for precedence constraints within scheduling problem
Do predators tend to have vertical slit pupils versus horizontal for prey animals?
Starships without computers?
Why is su world executable?
What causes burn marks on the air handler in the attic?
Align (multiline text)-nodes with tikzlibrary 'positioning'
Earliest evidence of objects intended for future archaeologists?
From France west coast to Portugal via ship?
What is "super" in superphosphate?
What is the evidence on the danger of feeding whole blueberries and grapes to infants and toddlers?
Reducing contention in thread-safe LruCache
How best to join tables, which have different lengths on the same column values which exist in both tables?
How to translate 脑袋短路 into English?
Why do aircraft leave the cruising altitude long before landing just to circle?
The Lucky House
Output with the same length always
Can 'in-' mean both 'in' and 'no'?
Independence of Mean and Variance of Discrete Uniform Distributions
Indirect speech - breaking the rules of it
Check disk usage of files returned with spaces
How to use source_location in a variadic template function?
How to shade a polygon with curved lines in tikz?
Rotate a node but not its content: the case of the ellipse decorationAbsolutely position arrow headUML StatediagramHow to define the default vertical distance between nodes?pgfplots markers and lines on different layersNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themProblems with nested TikZpictures
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to shade a polygon with red curved lines as shown in the MWE. I would like to shade the curved polygon enclosed by the points (A,B,C,D), i.e., the polygon ABCD.
MWE
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
draw [red, ultra thick] (3, 2) edge [bend right=10] (3.5, 0.57);
draw [red, ultra thick] (2, 3) edge [bend right=10] (2.5, 0.8);
draw [domain=2.5:3.5, ultra thick, red] plot (x, 2/x);
draw [domain=2:3, ultra thick, red] plot (x, 6/x);
node [above] at (2, 3) $C$;
node [below] at (2.5, 0.8) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 0.57) $A$;
endtikzpicture
enddocument
How to shade the polygon enclosed by ABCD with tikz?
tikz-pgf shading
add a comment |
I am trying to shade a polygon with red curved lines as shown in the MWE. I would like to shade the curved polygon enclosed by the points (A,B,C,D), i.e., the polygon ABCD.
MWE
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
draw [red, ultra thick] (3, 2) edge [bend right=10] (3.5, 0.57);
draw [red, ultra thick] (2, 3) edge [bend right=10] (2.5, 0.8);
draw [domain=2.5:3.5, ultra thick, red] plot (x, 2/x);
draw [domain=2:3, ultra thick, red] plot (x, 6/x);
node [above] at (2, 3) $C$;
node [below] at (2.5, 0.8) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 0.57) $A$;
endtikzpicture
enddocument
How to shade the polygon enclosed by ABCD with tikz?
tikz-pgf shading
add a comment |
I am trying to shade a polygon with red curved lines as shown in the MWE. I would like to shade the curved polygon enclosed by the points (A,B,C,D), i.e., the polygon ABCD.
MWE
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
draw [red, ultra thick] (3, 2) edge [bend right=10] (3.5, 0.57);
draw [red, ultra thick] (2, 3) edge [bend right=10] (2.5, 0.8);
draw [domain=2.5:3.5, ultra thick, red] plot (x, 2/x);
draw [domain=2:3, ultra thick, red] plot (x, 6/x);
node [above] at (2, 3) $C$;
node [below] at (2.5, 0.8) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 0.57) $A$;
endtikzpicture
enddocument
How to shade the polygon enclosed by ABCD with tikz?
tikz-pgf shading
I am trying to shade a polygon with red curved lines as shown in the MWE. I would like to shade the curved polygon enclosed by the points (A,B,C,D), i.e., the polygon ABCD.
MWE
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
draw [red, ultra thick] (3, 2) edge [bend right=10] (3.5, 0.57);
draw [red, ultra thick] (2, 3) edge [bend right=10] (2.5, 0.8);
draw [domain=2.5:3.5, ultra thick, red] plot (x, 2/x);
draw [domain=2:3, ultra thick, red] plot (x, 6/x);
node [above] at (2, 3) $C$;
node [below] at (2.5, 0.8) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 0.57) $A$;
endtikzpicture
enddocument
How to shade the polygon enclosed by ABCD with tikz?
tikz-pgf shading
tikz-pgf shading
edited 8 hours ago
Bernard
188k7 gold badges85 silver badges223 bronze badges
188k7 gold badges85 silver badges223 bronze badges
asked 9 hours ago
nxkryptornxkryptor
5953 silver badges11 bronze badges
5953 silver badges11 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Using fadings
library of TiKz:
documentclass[tikz,margin=5mm]standalone
usetikzlibraryfadings
makeatletter
pgfdeclareverticalshadingpgf@lib@fade@north100bp
color(0bp)=(pgftransparent!0);
color(5bp)=(pgftransparent!10);
color(60bp)=(pgftransparent!100); color(80bp)=(pgftransparent!100)%
pgfdeclarefadingmyfade%
pgfuseshadingpgf@lib@fade@east%
makeatother
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
draw [red, ultra thick] (3, 2)coordinate(D) edge [bend right=10] (3.5, 0.57)coordinate(A);
draw [red, ultra thick] (2, 3)coordinate(C) edge [bend right=10] (2.5, 0.8)coordinate(B);
draw [domain=2.5:3.5, ultra thick, red] plot (x, 2/x);
draw [domain=2:3, ultra thick, red] plot (x, 6/x);
node [above] at (2, 3) $C$;
node [below] at (2.5, 0.8) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 0.57) $A$;
fill[red,path fading=myfade] (3,2) to [bend right=10] (3.5,0.57)
to [bend left=10] (2.5,0.8) to [bend left=10] (2,3) to [bend right=10] (3,2);
endtikzpicture
enddocument
add a comment |
I don't know how you wanted it shaded, but if you draw it as a single path you can use for example shadedraw[left color=.., right color.., ]
.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
shadedraw[
draw=red,
ultra thick,
left color=blue,
right color=red,
bend angle=10
]
plot[domain=2.5:3.5] (x, 2/x)
to[bend left] (3,2)
plot[domain=3:2] (x, 6/x)
to[bend right] (2.5, 2/2.5);
node [above] at (2, 3) $C$;
node [below] at (2.5, 2/2.5) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 2/3.5) $A$;
endtikzpicture
enddocument
add a comment |
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
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f504740%2fhow-to-shade-a-polygon-with-curved-lines-in-tikz%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Using fadings
library of TiKz:
documentclass[tikz,margin=5mm]standalone
usetikzlibraryfadings
makeatletter
pgfdeclareverticalshadingpgf@lib@fade@north100bp
color(0bp)=(pgftransparent!0);
color(5bp)=(pgftransparent!10);
color(60bp)=(pgftransparent!100); color(80bp)=(pgftransparent!100)%
pgfdeclarefadingmyfade%
pgfuseshadingpgf@lib@fade@east%
makeatother
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
draw [red, ultra thick] (3, 2)coordinate(D) edge [bend right=10] (3.5, 0.57)coordinate(A);
draw [red, ultra thick] (2, 3)coordinate(C) edge [bend right=10] (2.5, 0.8)coordinate(B);
draw [domain=2.5:3.5, ultra thick, red] plot (x, 2/x);
draw [domain=2:3, ultra thick, red] plot (x, 6/x);
node [above] at (2, 3) $C$;
node [below] at (2.5, 0.8) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 0.57) $A$;
fill[red,path fading=myfade] (3,2) to [bend right=10] (3.5,0.57)
to [bend left=10] (2.5,0.8) to [bend left=10] (2,3) to [bend right=10] (3,2);
endtikzpicture
enddocument
add a comment |
Using fadings
library of TiKz:
documentclass[tikz,margin=5mm]standalone
usetikzlibraryfadings
makeatletter
pgfdeclareverticalshadingpgf@lib@fade@north100bp
color(0bp)=(pgftransparent!0);
color(5bp)=(pgftransparent!10);
color(60bp)=(pgftransparent!100); color(80bp)=(pgftransparent!100)%
pgfdeclarefadingmyfade%
pgfuseshadingpgf@lib@fade@east%
makeatother
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
draw [red, ultra thick] (3, 2)coordinate(D) edge [bend right=10] (3.5, 0.57)coordinate(A);
draw [red, ultra thick] (2, 3)coordinate(C) edge [bend right=10] (2.5, 0.8)coordinate(B);
draw [domain=2.5:3.5, ultra thick, red] plot (x, 2/x);
draw [domain=2:3, ultra thick, red] plot (x, 6/x);
node [above] at (2, 3) $C$;
node [below] at (2.5, 0.8) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 0.57) $A$;
fill[red,path fading=myfade] (3,2) to [bend right=10] (3.5,0.57)
to [bend left=10] (2.5,0.8) to [bend left=10] (2,3) to [bend right=10] (3,2);
endtikzpicture
enddocument
add a comment |
Using fadings
library of TiKz:
documentclass[tikz,margin=5mm]standalone
usetikzlibraryfadings
makeatletter
pgfdeclareverticalshadingpgf@lib@fade@north100bp
color(0bp)=(pgftransparent!0);
color(5bp)=(pgftransparent!10);
color(60bp)=(pgftransparent!100); color(80bp)=(pgftransparent!100)%
pgfdeclarefadingmyfade%
pgfuseshadingpgf@lib@fade@east%
makeatother
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
draw [red, ultra thick] (3, 2)coordinate(D) edge [bend right=10] (3.5, 0.57)coordinate(A);
draw [red, ultra thick] (2, 3)coordinate(C) edge [bend right=10] (2.5, 0.8)coordinate(B);
draw [domain=2.5:3.5, ultra thick, red] plot (x, 2/x);
draw [domain=2:3, ultra thick, red] plot (x, 6/x);
node [above] at (2, 3) $C$;
node [below] at (2.5, 0.8) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 0.57) $A$;
fill[red,path fading=myfade] (3,2) to [bend right=10] (3.5,0.57)
to [bend left=10] (2.5,0.8) to [bend left=10] (2,3) to [bend right=10] (3,2);
endtikzpicture
enddocument
Using fadings
library of TiKz:
documentclass[tikz,margin=5mm]standalone
usetikzlibraryfadings
makeatletter
pgfdeclareverticalshadingpgf@lib@fade@north100bp
color(0bp)=(pgftransparent!0);
color(5bp)=(pgftransparent!10);
color(60bp)=(pgftransparent!100); color(80bp)=(pgftransparent!100)%
pgfdeclarefadingmyfade%
pgfuseshadingpgf@lib@fade@east%
makeatother
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
draw [red, ultra thick] (3, 2)coordinate(D) edge [bend right=10] (3.5, 0.57)coordinate(A);
draw [red, ultra thick] (2, 3)coordinate(C) edge [bend right=10] (2.5, 0.8)coordinate(B);
draw [domain=2.5:3.5, ultra thick, red] plot (x, 2/x);
draw [domain=2:3, ultra thick, red] plot (x, 6/x);
node [above] at (2, 3) $C$;
node [below] at (2.5, 0.8) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 0.57) $A$;
fill[red,path fading=myfade] (3,2) to [bend right=10] (3.5,0.57)
to [bend left=10] (2.5,0.8) to [bend left=10] (2,3) to [bend right=10] (3,2);
endtikzpicture
enddocument
answered 8 hours ago
ferahfezaferahfeza
10.3k1 gold badge21 silver badges40 bronze badges
10.3k1 gold badge21 silver badges40 bronze badges
add a comment |
add a comment |
I don't know how you wanted it shaded, but if you draw it as a single path you can use for example shadedraw[left color=.., right color.., ]
.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
shadedraw[
draw=red,
ultra thick,
left color=blue,
right color=red,
bend angle=10
]
plot[domain=2.5:3.5] (x, 2/x)
to[bend left] (3,2)
plot[domain=3:2] (x, 6/x)
to[bend right] (2.5, 2/2.5);
node [above] at (2, 3) $C$;
node [below] at (2.5, 2/2.5) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 2/3.5) $A$;
endtikzpicture
enddocument
add a comment |
I don't know how you wanted it shaded, but if you draw it as a single path you can use for example shadedraw[left color=.., right color.., ]
.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
shadedraw[
draw=red,
ultra thick,
left color=blue,
right color=red,
bend angle=10
]
plot[domain=2.5:3.5] (x, 2/x)
to[bend left] (3,2)
plot[domain=3:2] (x, 6/x)
to[bend right] (2.5, 2/2.5);
node [above] at (2, 3) $C$;
node [below] at (2.5, 2/2.5) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 2/3.5) $A$;
endtikzpicture
enddocument
add a comment |
I don't know how you wanted it shaded, but if you draw it as a single path you can use for example shadedraw[left color=.., right color.., ]
.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
shadedraw[
draw=red,
ultra thick,
left color=blue,
right color=red,
bend angle=10
]
plot[domain=2.5:3.5] (x, 2/x)
to[bend left] (3,2)
plot[domain=3:2] (x, 6/x)
to[bend right] (2.5, 2/2.5);
node [above] at (2, 3) $C$;
node [below] at (2.5, 2/2.5) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 2/3.5) $A$;
endtikzpicture
enddocument
I don't know how you wanted it shaded, but if you draw it as a single path you can use for example shadedraw[left color=.., right color.., ]
.
documentclassarticle
usepackagestandalone
usepackagetikz
begindocument
begintikzpicture
draw [->] (0, 0) -- (5, 0) node [right] $X$;
draw [->] (0, 0) -- (0, 3) node [above] $Y$;
draw [domain=0.66:4.5, thick, blue] plot (x, 2/x);
draw [domain=1.66:4.5, thick, blue] plot (x, 6/x);
shadedraw[
draw=red,
ultra thick,
left color=blue,
right color=red,
bend angle=10
]
plot[domain=2.5:3.5] (x, 2/x)
to[bend left] (3,2)
plot[domain=3:2] (x, 6/x)
to[bend right] (2.5, 2/2.5);
node [above] at (2, 3) $C$;
node [below] at (2.5, 2/2.5) $B$;
node [above] at (3, 2) $D$;
node [below] at (3.5, 2/3.5) $A$;
endtikzpicture
enddocument
answered 8 hours ago
Torbjørn T.Torbjørn T.
164k13 gold badges269 silver badges455 bronze badges
164k13 gold badges269 silver badges455 bronze badges
add a comment |
add a comment |
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.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f504740%2fhow-to-shade-a-polygon-with-curved-lines-in-tikz%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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