How to draw a circle intersecting a shaded non-uniform shape using tikz?
I am trying to draw this picture:
I have tried a lot of things, like defining this
newcommandirregularcircle[2]{
pgfextra {pgfmathsetmacrolen{(#1)+rand*(#2)}}
+(0:len pt)
foreach a in {10,20,...,120}{
pgfextra {pgfmathsetmacrolen{(#1)+rand*(#2)}}
-- +(a:len pt)
} -- cycle
}
But it don't give a figure that can be between the x-axis and the circle, and I don't know how to do this. Thanks.
tikz-pgf
add a comment |
I am trying to draw this picture:
I have tried a lot of things, like defining this
newcommandirregularcircle[2]{
pgfextra {pgfmathsetmacrolen{(#1)+rand*(#2)}}
+(0:len pt)
foreach a in {10,20,...,120}{
pgfextra {pgfmathsetmacrolen{(#1)+rand*(#2)}}
-- +(a:len pt)
} -- cycle
}
But it don't give a figure that can be between the x-axis and the circle, and I don't know how to do this. Thanks.
tikz-pgf
Try tikzedt.org
– sandu
20 hours ago
add a comment |
I am trying to draw this picture:
I have tried a lot of things, like defining this
newcommandirregularcircle[2]{
pgfextra {pgfmathsetmacrolen{(#1)+rand*(#2)}}
+(0:len pt)
foreach a in {10,20,...,120}{
pgfextra {pgfmathsetmacrolen{(#1)+rand*(#2)}}
-- +(a:len pt)
} -- cycle
}
But it don't give a figure that can be between the x-axis and the circle, and I don't know how to do this. Thanks.
tikz-pgf
I am trying to draw this picture:
I have tried a lot of things, like defining this
newcommandirregularcircle[2]{
pgfextra {pgfmathsetmacrolen{(#1)+rand*(#2)}}
+(0:len pt)
foreach a in {10,20,...,120}{
pgfextra {pgfmathsetmacrolen{(#1)+rand*(#2)}}
-- +(a:len pt)
} -- cycle
}
But it don't give a figure that can be between the x-axis and the circle, and I don't know how to do this. Thanks.
tikz-pgf
tikz-pgf
edited 9 hours ago
JouleV
8,15222153
8,15222153
asked 20 hours ago
J.RodriguezJ.Rodriguez
1065
1065
Try tikzedt.org
– sandu
20 hours ago
add a comment |
Try tikzedt.org
– sandu
20 hours ago
Try tikzedt.org
– sandu
20 hours ago
Try tikzedt.org
– sandu
20 hours ago
add a comment |
1 Answer
1
active
oldest
votes
One possibility is tp build up a random list and plots a smooth curve through it.
documentclass[tikz,border=3.14mm]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}
pgfmathsetseed{9}
foreach X in {0,...,11}
{ifnumX=0
pgfmathsetmacro{myradius}{2}
xdefmyLst{myradius}
else
pgfmathsetmacro{myradius}{{myLst}[X-1]+0.5*(rnd-0.5)}
xdefmyLst{myLst,myradius}
fi}
xdefmyLst{myLst,2}
draw[pattern=north east lines] (2,0) --
plot[smooth,variable=x,samples at={0,...,12}]
([xshift=2cm]-x*10:{{myLst}[x]}) -- (-60:2) arc(-60:0:2);
draw (120:2) arc (120:-120:2);
draw[-latex] (0,0) -- (5,0);
draw[dashed] (2,0) -- (2,-pi);
draw (2,0) -- ++ (-120:pi);
draw[latex-latex] (2,0) + (-120:2.7) arc(-120:-90:2.7) node[midway,below]{$mu$};
draw[-latex] (2,0) -- ++ (-45:1) node[pos=1.2]{$z$};
end{tikzpicture}
end{document}
8
Marmot, you are a tikz god. Its the 4th question that you answer to me. Thanks a lot. I will put you in my acknowledgments of the tesis.
– J.Rodriguez
20 hours ago
1
@J.Rodriguez It's my pleasure and no need to put acknowledgments.
– marmot
20 hours ago
4
@marmot should be in a lot of thesis.
– manooooh
19 hours ago
@marmot Miss mathcal{U}_1? :-)
– Sebastiano
13 hours ago
1
@Sebastiano I do not understand the comment. But please do not expect me to update my answer to add a U, there are several other things in the screen shot which I did not put in but the OP seems to be happy with it. This answer is only on the circle with some noise added on the radius.
– marmot
8 hours ago
|
show 2 more comments
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%2f481460%2fhow-to-draw-a-circle-intersecting-a-shaded-non-uniform-shape-using-tikz%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
One possibility is tp build up a random list and plots a smooth curve through it.
documentclass[tikz,border=3.14mm]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}
pgfmathsetseed{9}
foreach X in {0,...,11}
{ifnumX=0
pgfmathsetmacro{myradius}{2}
xdefmyLst{myradius}
else
pgfmathsetmacro{myradius}{{myLst}[X-1]+0.5*(rnd-0.5)}
xdefmyLst{myLst,myradius}
fi}
xdefmyLst{myLst,2}
draw[pattern=north east lines] (2,0) --
plot[smooth,variable=x,samples at={0,...,12}]
([xshift=2cm]-x*10:{{myLst}[x]}) -- (-60:2) arc(-60:0:2);
draw (120:2) arc (120:-120:2);
draw[-latex] (0,0) -- (5,0);
draw[dashed] (2,0) -- (2,-pi);
draw (2,0) -- ++ (-120:pi);
draw[latex-latex] (2,0) + (-120:2.7) arc(-120:-90:2.7) node[midway,below]{$mu$};
draw[-latex] (2,0) -- ++ (-45:1) node[pos=1.2]{$z$};
end{tikzpicture}
end{document}
8
Marmot, you are a tikz god. Its the 4th question that you answer to me. Thanks a lot. I will put you in my acknowledgments of the tesis.
– J.Rodriguez
20 hours ago
1
@J.Rodriguez It's my pleasure and no need to put acknowledgments.
– marmot
20 hours ago
4
@marmot should be in a lot of thesis.
– manooooh
19 hours ago
@marmot Miss mathcal{U}_1? :-)
– Sebastiano
13 hours ago
1
@Sebastiano I do not understand the comment. But please do not expect me to update my answer to add a U, there are several other things in the screen shot which I did not put in but the OP seems to be happy with it. This answer is only on the circle with some noise added on the radius.
– marmot
8 hours ago
|
show 2 more comments
One possibility is tp build up a random list and plots a smooth curve through it.
documentclass[tikz,border=3.14mm]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}
pgfmathsetseed{9}
foreach X in {0,...,11}
{ifnumX=0
pgfmathsetmacro{myradius}{2}
xdefmyLst{myradius}
else
pgfmathsetmacro{myradius}{{myLst}[X-1]+0.5*(rnd-0.5)}
xdefmyLst{myLst,myradius}
fi}
xdefmyLst{myLst,2}
draw[pattern=north east lines] (2,0) --
plot[smooth,variable=x,samples at={0,...,12}]
([xshift=2cm]-x*10:{{myLst}[x]}) -- (-60:2) arc(-60:0:2);
draw (120:2) arc (120:-120:2);
draw[-latex] (0,0) -- (5,0);
draw[dashed] (2,0) -- (2,-pi);
draw (2,0) -- ++ (-120:pi);
draw[latex-latex] (2,0) + (-120:2.7) arc(-120:-90:2.7) node[midway,below]{$mu$};
draw[-latex] (2,0) -- ++ (-45:1) node[pos=1.2]{$z$};
end{tikzpicture}
end{document}
8
Marmot, you are a tikz god. Its the 4th question that you answer to me. Thanks a lot. I will put you in my acknowledgments of the tesis.
– J.Rodriguez
20 hours ago
1
@J.Rodriguez It's my pleasure and no need to put acknowledgments.
– marmot
20 hours ago
4
@marmot should be in a lot of thesis.
– manooooh
19 hours ago
@marmot Miss mathcal{U}_1? :-)
– Sebastiano
13 hours ago
1
@Sebastiano I do not understand the comment. But please do not expect me to update my answer to add a U, there are several other things in the screen shot which I did not put in but the OP seems to be happy with it. This answer is only on the circle with some noise added on the radius.
– marmot
8 hours ago
|
show 2 more comments
One possibility is tp build up a random list and plots a smooth curve through it.
documentclass[tikz,border=3.14mm]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}
pgfmathsetseed{9}
foreach X in {0,...,11}
{ifnumX=0
pgfmathsetmacro{myradius}{2}
xdefmyLst{myradius}
else
pgfmathsetmacro{myradius}{{myLst}[X-1]+0.5*(rnd-0.5)}
xdefmyLst{myLst,myradius}
fi}
xdefmyLst{myLst,2}
draw[pattern=north east lines] (2,0) --
plot[smooth,variable=x,samples at={0,...,12}]
([xshift=2cm]-x*10:{{myLst}[x]}) -- (-60:2) arc(-60:0:2);
draw (120:2) arc (120:-120:2);
draw[-latex] (0,0) -- (5,0);
draw[dashed] (2,0) -- (2,-pi);
draw (2,0) -- ++ (-120:pi);
draw[latex-latex] (2,0) + (-120:2.7) arc(-120:-90:2.7) node[midway,below]{$mu$};
draw[-latex] (2,0) -- ++ (-45:1) node[pos=1.2]{$z$};
end{tikzpicture}
end{document}
One possibility is tp build up a random list and plots a smooth curve through it.
documentclass[tikz,border=3.14mm]{standalone}
usetikzlibrary{patterns}
begin{document}
begin{tikzpicture}
pgfmathsetseed{9}
foreach X in {0,...,11}
{ifnumX=0
pgfmathsetmacro{myradius}{2}
xdefmyLst{myradius}
else
pgfmathsetmacro{myradius}{{myLst}[X-1]+0.5*(rnd-0.5)}
xdefmyLst{myLst,myradius}
fi}
xdefmyLst{myLst,2}
draw[pattern=north east lines] (2,0) --
plot[smooth,variable=x,samples at={0,...,12}]
([xshift=2cm]-x*10:{{myLst}[x]}) -- (-60:2) arc(-60:0:2);
draw (120:2) arc (120:-120:2);
draw[-latex] (0,0) -- (5,0);
draw[dashed] (2,0) -- (2,-pi);
draw (2,0) -- ++ (-120:pi);
draw[latex-latex] (2,0) + (-120:2.7) arc(-120:-90:2.7) node[midway,below]{$mu$};
draw[-latex] (2,0) -- ++ (-45:1) node[pos=1.2]{$z$};
end{tikzpicture}
end{document}
edited 19 hours ago
answered 20 hours ago
marmotmarmot
112k5141267
112k5141267
8
Marmot, you are a tikz god. Its the 4th question that you answer to me. Thanks a lot. I will put you in my acknowledgments of the tesis.
– J.Rodriguez
20 hours ago
1
@J.Rodriguez It's my pleasure and no need to put acknowledgments.
– marmot
20 hours ago
4
@marmot should be in a lot of thesis.
– manooooh
19 hours ago
@marmot Miss mathcal{U}_1? :-)
– Sebastiano
13 hours ago
1
@Sebastiano I do not understand the comment. But please do not expect me to update my answer to add a U, there are several other things in the screen shot which I did not put in but the OP seems to be happy with it. This answer is only on the circle with some noise added on the radius.
– marmot
8 hours ago
|
show 2 more comments
8
Marmot, you are a tikz god. Its the 4th question that you answer to me. Thanks a lot. I will put you in my acknowledgments of the tesis.
– J.Rodriguez
20 hours ago
1
@J.Rodriguez It's my pleasure and no need to put acknowledgments.
– marmot
20 hours ago
4
@marmot should be in a lot of thesis.
– manooooh
19 hours ago
@marmot Miss mathcal{U}_1? :-)
– Sebastiano
13 hours ago
1
@Sebastiano I do not understand the comment. But please do not expect me to update my answer to add a U, there are several other things in the screen shot which I did not put in but the OP seems to be happy with it. This answer is only on the circle with some noise added on the radius.
– marmot
8 hours ago
8
8
Marmot, you are a tikz god. Its the 4th question that you answer to me. Thanks a lot. I will put you in my acknowledgments of the tesis.
– J.Rodriguez
20 hours ago
Marmot, you are a tikz god. Its the 4th question that you answer to me. Thanks a lot. I will put you in my acknowledgments of the tesis.
– J.Rodriguez
20 hours ago
1
1
@J.Rodriguez It's my pleasure and no need to put acknowledgments.
– marmot
20 hours ago
@J.Rodriguez It's my pleasure and no need to put acknowledgments.
– marmot
20 hours ago
4
4
@marmot should be in a lot of thesis.
– manooooh
19 hours ago
@marmot should be in a lot of thesis.
– manooooh
19 hours ago
@marmot Miss mathcal{U}_1? :-)
– Sebastiano
13 hours ago
@marmot Miss mathcal{U}_1? :-)
– Sebastiano
13 hours ago
1
1
@Sebastiano I do not understand the comment. But please do not expect me to update my answer to add a U, there are several other things in the screen shot which I did not put in but the OP seems to be happy with it. This answer is only on the circle with some noise added on the radius.
– marmot
8 hours ago
@Sebastiano I do not understand the comment. But please do not expect me to update my answer to add a U, there are several other things in the screen shot which I did not put in but the OP seems to be happy with it. This answer is only on the circle with some noise added on the radius.
– marmot
8 hours ago
|
show 2 more comments
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%2f481460%2fhow-to-draw-a-circle-intersecting-a-shaded-non-uniform-shape-using-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
Try tikzedt.org
– sandu
20 hours ago