draw graph showing the distribution of energy

Multi tool use
Could you help me to draw the last option using in/out draw? Other way is ok.
documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](0,0) to[out=10, in=199] (1.25,2);
draw[red, thick](1.25,2) to[out=-5, in=170] (3.75,0.5);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](1.5,0) to[out=50, in=119] (2,2.5);
draw[red, thick](2,2.5) to[out=-70, in=111] (2.5,0);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.2,2.2) to[out=-70, in=179] (3.6,.55);
end{tikzpicture}
begin{tikzpicture}[scale=.71 ]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.3,.0) to[out=70, in=179] (1.2,1.7);
end{tikzpicture}
end{document}
tikz-pgf
add a comment |
Could you help me to draw the last option using in/out draw? Other way is ok.
documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](0,0) to[out=10, in=199] (1.25,2);
draw[red, thick](1.25,2) to[out=-5, in=170] (3.75,0.5);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](1.5,0) to[out=50, in=119] (2,2.5);
draw[red, thick](2,2.5) to[out=-70, in=111] (2.5,0);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.2,2.2) to[out=-70, in=179] (3.6,.55);
end{tikzpicture}
begin{tikzpicture}[scale=.71 ]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.3,.0) to[out=70, in=179] (1.2,1.7);
end{tikzpicture}
end{document}
tikz-pgf
add a comment |
Could you help me to draw the last option using in/out draw? Other way is ok.
documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](0,0) to[out=10, in=199] (1.25,2);
draw[red, thick](1.25,2) to[out=-5, in=170] (3.75,0.5);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](1.5,0) to[out=50, in=119] (2,2.5);
draw[red, thick](2,2.5) to[out=-70, in=111] (2.5,0);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.2,2.2) to[out=-70, in=179] (3.6,.55);
end{tikzpicture}
begin{tikzpicture}[scale=.71 ]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.3,.0) to[out=70, in=179] (1.2,1.7);
end{tikzpicture}
end{document}
tikz-pgf
Could you help me to draw the last option using in/out draw? Other way is ok.
documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](0,0) to[out=10, in=199] (1.25,2);
draw[red, thick](1.25,2) to[out=-5, in=170] (3.75,0.5);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](1.5,0) to[out=50, in=119] (2,2.5);
draw[red, thick](2,2.5) to[out=-70, in=111] (2.5,0);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.2,2.2) to[out=-70, in=179] (3.6,.55);
end{tikzpicture}
begin{tikzpicture}[scale=.71 ]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.3,.0) to[out=70, in=179] (1.2,1.7);
end{tikzpicture}
end{document}
tikz-pgf
tikz-pgf
edited Jan 4 at 4:01


marmot
90.7k4104195
90.7k4104195
asked Jan 4 at 3:55
ThumboltThumbolt
1,396819
1,396819
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I would like to argue that the simplest way is to define some standard functions and plot a linear combination of them.
documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](0,0) to[out=10, in=199] (1.25,2);
draw[red, thick](1.25,2) to[out=-5, in=170] (3.75,0.5);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](1.5,0) to[out=50, in=119] (2,2.5);
draw[red, thick](2,2.5) to[out=-70, in=111] (2.5,0);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.2,2.2) to[out=-70, in=179] (3.6,.55);
end{tikzpicture}
begin{tikzpicture}[scale=.71,declare function={
fcont(x)=x*x*exp(-2*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
end{document}
I could not resist to draw the other curves using the same strategy, and also arranging the plots in a 2x2 scheme.
documentclass{article}
usepackage{subcaption}
usepackage{tikz}
tikzset{declare function={
fcont(x,b)=x*x*exp(-2*b*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}}
begin{document}
begin{figure}
centering
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{8*fcont(x,0.8)});
end{tikzpicture}
caption{I look like a Planck distribution.}label{fig:Planck}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=1.6:2.4,samples=81]
({x},{2.5*(fpeak(x,2,0.2)-fpeak(1.6,2,0.2))});
end{tikzpicture}
caption{I look like a Gaussian peak.}label{fig:Gauss}
end{subfigure}\
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{2*exp(-x)});
end{tikzpicture}
caption{I look like a an exponentially decaying function.}label{fig:Exp}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x,1)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
caption{I look like a Planck distribution plus two Gaussian
peaks.}label{fig:Spectrum}
end{subfigure}
caption{Cartoons of a few distributions that often occur in science.}
end{figure}
end{document}
I had to adjust the prefactors by trial and error. This is not necessary if you switch to pgfplots, where you can use group plots to arrange the plots in a 2x2 scheme, too.
1
The graphs look much better. Thank you for the improvement.
– Thumbolt
Jan 4 at 5:42
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%2f468503%2fdraw-graph-showing-the-distribution-of-energy%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
I would like to argue that the simplest way is to define some standard functions and plot a linear combination of them.
documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](0,0) to[out=10, in=199] (1.25,2);
draw[red, thick](1.25,2) to[out=-5, in=170] (3.75,0.5);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](1.5,0) to[out=50, in=119] (2,2.5);
draw[red, thick](2,2.5) to[out=-70, in=111] (2.5,0);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.2,2.2) to[out=-70, in=179] (3.6,.55);
end{tikzpicture}
begin{tikzpicture}[scale=.71,declare function={
fcont(x)=x*x*exp(-2*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
end{document}
I could not resist to draw the other curves using the same strategy, and also arranging the plots in a 2x2 scheme.
documentclass{article}
usepackage{subcaption}
usepackage{tikz}
tikzset{declare function={
fcont(x,b)=x*x*exp(-2*b*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}}
begin{document}
begin{figure}
centering
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{8*fcont(x,0.8)});
end{tikzpicture}
caption{I look like a Planck distribution.}label{fig:Planck}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=1.6:2.4,samples=81]
({x},{2.5*(fpeak(x,2,0.2)-fpeak(1.6,2,0.2))});
end{tikzpicture}
caption{I look like a Gaussian peak.}label{fig:Gauss}
end{subfigure}\
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{2*exp(-x)});
end{tikzpicture}
caption{I look like a an exponentially decaying function.}label{fig:Exp}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x,1)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
caption{I look like a Planck distribution plus two Gaussian
peaks.}label{fig:Spectrum}
end{subfigure}
caption{Cartoons of a few distributions that often occur in science.}
end{figure}
end{document}
I had to adjust the prefactors by trial and error. This is not necessary if you switch to pgfplots, where you can use group plots to arrange the plots in a 2x2 scheme, too.
1
The graphs look much better. Thank you for the improvement.
– Thumbolt
Jan 4 at 5:42
add a comment |
I would like to argue that the simplest way is to define some standard functions and plot a linear combination of them.
documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](0,0) to[out=10, in=199] (1.25,2);
draw[red, thick](1.25,2) to[out=-5, in=170] (3.75,0.5);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](1.5,0) to[out=50, in=119] (2,2.5);
draw[red, thick](2,2.5) to[out=-70, in=111] (2.5,0);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.2,2.2) to[out=-70, in=179] (3.6,.55);
end{tikzpicture}
begin{tikzpicture}[scale=.71,declare function={
fcont(x)=x*x*exp(-2*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
end{document}
I could not resist to draw the other curves using the same strategy, and also arranging the plots in a 2x2 scheme.
documentclass{article}
usepackage{subcaption}
usepackage{tikz}
tikzset{declare function={
fcont(x,b)=x*x*exp(-2*b*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}}
begin{document}
begin{figure}
centering
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{8*fcont(x,0.8)});
end{tikzpicture}
caption{I look like a Planck distribution.}label{fig:Planck}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=1.6:2.4,samples=81]
({x},{2.5*(fpeak(x,2,0.2)-fpeak(1.6,2,0.2))});
end{tikzpicture}
caption{I look like a Gaussian peak.}label{fig:Gauss}
end{subfigure}\
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{2*exp(-x)});
end{tikzpicture}
caption{I look like a an exponentially decaying function.}label{fig:Exp}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x,1)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
caption{I look like a Planck distribution plus two Gaussian
peaks.}label{fig:Spectrum}
end{subfigure}
caption{Cartoons of a few distributions that often occur in science.}
end{figure}
end{document}
I had to adjust the prefactors by trial and error. This is not necessary if you switch to pgfplots, where you can use group plots to arrange the plots in a 2x2 scheme, too.
1
The graphs look much better. Thank you for the improvement.
– Thumbolt
Jan 4 at 5:42
add a comment |
I would like to argue that the simplest way is to define some standard functions and plot a linear combination of them.
documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](0,0) to[out=10, in=199] (1.25,2);
draw[red, thick](1.25,2) to[out=-5, in=170] (3.75,0.5);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](1.5,0) to[out=50, in=119] (2,2.5);
draw[red, thick](2,2.5) to[out=-70, in=111] (2.5,0);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.2,2.2) to[out=-70, in=179] (3.6,.55);
end{tikzpicture}
begin{tikzpicture}[scale=.71,declare function={
fcont(x)=x*x*exp(-2*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
end{document}
I could not resist to draw the other curves using the same strategy, and also arranging the plots in a 2x2 scheme.
documentclass{article}
usepackage{subcaption}
usepackage{tikz}
tikzset{declare function={
fcont(x,b)=x*x*exp(-2*b*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}}
begin{document}
begin{figure}
centering
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{8*fcont(x,0.8)});
end{tikzpicture}
caption{I look like a Planck distribution.}label{fig:Planck}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=1.6:2.4,samples=81]
({x},{2.5*(fpeak(x,2,0.2)-fpeak(1.6,2,0.2))});
end{tikzpicture}
caption{I look like a Gaussian peak.}label{fig:Gauss}
end{subfigure}\
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{2*exp(-x)});
end{tikzpicture}
caption{I look like a an exponentially decaying function.}label{fig:Exp}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x,1)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
caption{I look like a Planck distribution plus two Gaussian
peaks.}label{fig:Spectrum}
end{subfigure}
caption{Cartoons of a few distributions that often occur in science.}
end{figure}
end{document}
I had to adjust the prefactors by trial and error. This is not necessary if you switch to pgfplots, where you can use group plots to arrange the plots in a 2x2 scheme, too.
I would like to argue that the simplest way is to define some standard functions and plot a linear combination of them.
documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](0,0) to[out=10, in=199] (1.25,2);
draw[red, thick](1.25,2) to[out=-5, in=170] (3.75,0.5);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick](1.5,0) to[out=50, in=119] (2,2.5);
draw[red, thick](2,2.5) to[out=-70, in=111] (2.5,0);
end{tikzpicture}
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick](0.2,2.2) to[out=-70, in=179] (3.6,.55);
end{tikzpicture}
begin{tikzpicture}[scale=.71,declare function={
fcont(x)=x*x*exp(-2*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.414);
draw(4.15,0) node[right] {$E$};
draw(0,2.41) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
end{document}
I could not resist to draw the other curves using the same strategy, and also arranging the plots in a 2x2 scheme.
documentclass{article}
usepackage{subcaption}
usepackage{tikz}
tikzset{declare function={
fcont(x,b)=x*x*exp(-2*b*x);
fpeak(x,y,z)=exp(-(x-y)*(x-y)/(z*z));}}
begin{document}
begin{figure}
centering
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{8*fcont(x,0.8)});
end{tikzpicture}
caption{I look like a Planck distribution.}label{fig:Planck}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=1.6:2.4,samples=81]
({x},{2.5*(fpeak(x,2,0.2)-fpeak(1.6,2,0.2))});
end{tikzpicture}
caption{I look like a Gaussian peak.}label{fig:Gauss}
end{subfigure}\
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:4,samples=81]
({x},{2*exp(-x)});
end{tikzpicture}
caption{I look like a an exponentially decaying function.}label{fig:Exp}
end{subfigure}
quad
begin{subfigure}{0.4textwidth}
centering
begin{tikzpicture}[scale=.71]
draw[->](0,0)--(4.05,0);
draw[->](0,-.3)--(0,2.14);
draw(4.15,0) node[right] {$E$};
draw(0,2.1) node[above] {$p(E)$};
draw[red, thick] plot[smooth,variable=x,domain=0:3.5,samples=81]
({x+0.5},{10*fcont(x,1)+1.3*fpeak(x,1.3,0.05)+0.9*fpeak(x,1,0.05)});
end{tikzpicture}
caption{I look like a Planck distribution plus two Gaussian
peaks.}label{fig:Spectrum}
end{subfigure}
caption{Cartoons of a few distributions that often occur in science.}
end{figure}
end{document}
I had to adjust the prefactors by trial and error. This is not necessary if you switch to pgfplots, where you can use group plots to arrange the plots in a 2x2 scheme, too.
edited Jan 4 at 4:30
answered Jan 4 at 4:10


marmotmarmot
90.7k4104195
90.7k4104195
1
The graphs look much better. Thank you for the improvement.
– Thumbolt
Jan 4 at 5:42
add a comment |
1
The graphs look much better. Thank you for the improvement.
– Thumbolt
Jan 4 at 5:42
1
1
The graphs look much better. Thank you for the improvement.
– Thumbolt
Jan 4 at 5:42
The graphs look much better. Thank you for the improvement.
– Thumbolt
Jan 4 at 5:42
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%2f468503%2fdraw-graph-showing-the-distribution-of-energy%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
rJI,pwUJ,IEGtslhDjbInYpuiMToWd8,Wk 0R