Plotting multiple functions in pgfplots












0















I have a function that I want to graph. However, there are 10 variations of it with 5 different constants each. I do not want to simply plug in a number 50 times. Is there an easier way to do this? Also, the graph comes out strangely. Is there an alternative to pgfplotsthat I use to generate an image and then just use includegraphics, preferably something with vector graphics so that it is of the highest quality. Thank you.



documentclass[letterpaper]{article}
usepackage{pgfplots} pgfplotsset{width=10cm,compat=1.16}

begin{document}


[ y^{prime} ( t ) = frac{lambda phi ( beta - alpha )}{t left[ 1 + ( t/gamma)^{-phi} right]^lambda left[ 1 + (t/gamma)^{phi} right]} ]


begin{figure}[htbp!]
centering
begin{tikzpicture}
begin{axis}[
legend pos=north east,
title = {},
xlabel = {time},
ylabel = {temperature},
xmin = 0, xmax = 15,
ymin = 0, ymax = 8,
xtick = {0, 5, 10, 15},
ytick = {0, 2, 4, 6, 8},
]

addplot[black, no marks, domain=0.01:15, smooth]{(1.86*3.38*(42.2 - 23.3))/(x*(1 + (x/3.15)^(-3.38))^(1.86)*(1 + (x/3.15)^(3.38)))};
addlegendentry{fitted function}

addplot[red, no marks, domain=0.01:15, smooth]{(12*3.01*(43.6 - 23.8))/(x*(1 + (x/1.38)^(-3.01))^(12)*(1 + (x/1.38)^(3.01)))};
addlegendentry{fitted function2}

end{axis}
end{tikzpicture}

end{figure}

end{document}









share|improve this question























  • Yes, that's what declare function is for.

    – marmot
    3 mins ago











  • @marmot Thank you, but an example please? Also any suggestions for making the graph look better or other options?

    – Ilyankor
    1 min ago


















0















I have a function that I want to graph. However, there are 10 variations of it with 5 different constants each. I do not want to simply plug in a number 50 times. Is there an easier way to do this? Also, the graph comes out strangely. Is there an alternative to pgfplotsthat I use to generate an image and then just use includegraphics, preferably something with vector graphics so that it is of the highest quality. Thank you.



documentclass[letterpaper]{article}
usepackage{pgfplots} pgfplotsset{width=10cm,compat=1.16}

begin{document}


[ y^{prime} ( t ) = frac{lambda phi ( beta - alpha )}{t left[ 1 + ( t/gamma)^{-phi} right]^lambda left[ 1 + (t/gamma)^{phi} right]} ]


begin{figure}[htbp!]
centering
begin{tikzpicture}
begin{axis}[
legend pos=north east,
title = {},
xlabel = {time},
ylabel = {temperature},
xmin = 0, xmax = 15,
ymin = 0, ymax = 8,
xtick = {0, 5, 10, 15},
ytick = {0, 2, 4, 6, 8},
]

addplot[black, no marks, domain=0.01:15, smooth]{(1.86*3.38*(42.2 - 23.3))/(x*(1 + (x/3.15)^(-3.38))^(1.86)*(1 + (x/3.15)^(3.38)))};
addlegendentry{fitted function}

addplot[red, no marks, domain=0.01:15, smooth]{(12*3.01*(43.6 - 23.8))/(x*(1 + (x/1.38)^(-3.01))^(12)*(1 + (x/1.38)^(3.01)))};
addlegendentry{fitted function2}

end{axis}
end{tikzpicture}

end{figure}

end{document}









share|improve this question























  • Yes, that's what declare function is for.

    – marmot
    3 mins ago











  • @marmot Thank you, but an example please? Also any suggestions for making the graph look better or other options?

    – Ilyankor
    1 min ago
















0












0








0








I have a function that I want to graph. However, there are 10 variations of it with 5 different constants each. I do not want to simply plug in a number 50 times. Is there an easier way to do this? Also, the graph comes out strangely. Is there an alternative to pgfplotsthat I use to generate an image and then just use includegraphics, preferably something with vector graphics so that it is of the highest quality. Thank you.



documentclass[letterpaper]{article}
usepackage{pgfplots} pgfplotsset{width=10cm,compat=1.16}

begin{document}


[ y^{prime} ( t ) = frac{lambda phi ( beta - alpha )}{t left[ 1 + ( t/gamma)^{-phi} right]^lambda left[ 1 + (t/gamma)^{phi} right]} ]


begin{figure}[htbp!]
centering
begin{tikzpicture}
begin{axis}[
legend pos=north east,
title = {},
xlabel = {time},
ylabel = {temperature},
xmin = 0, xmax = 15,
ymin = 0, ymax = 8,
xtick = {0, 5, 10, 15},
ytick = {0, 2, 4, 6, 8},
]

addplot[black, no marks, domain=0.01:15, smooth]{(1.86*3.38*(42.2 - 23.3))/(x*(1 + (x/3.15)^(-3.38))^(1.86)*(1 + (x/3.15)^(3.38)))};
addlegendentry{fitted function}

addplot[red, no marks, domain=0.01:15, smooth]{(12*3.01*(43.6 - 23.8))/(x*(1 + (x/1.38)^(-3.01))^(12)*(1 + (x/1.38)^(3.01)))};
addlegendentry{fitted function2}

end{axis}
end{tikzpicture}

end{figure}

end{document}









share|improve this question














I have a function that I want to graph. However, there are 10 variations of it with 5 different constants each. I do not want to simply plug in a number 50 times. Is there an easier way to do this? Also, the graph comes out strangely. Is there an alternative to pgfplotsthat I use to generate an image and then just use includegraphics, preferably something with vector graphics so that it is of the highest quality. Thank you.



documentclass[letterpaper]{article}
usepackage{pgfplots} pgfplotsset{width=10cm,compat=1.16}

begin{document}


[ y^{prime} ( t ) = frac{lambda phi ( beta - alpha )}{t left[ 1 + ( t/gamma)^{-phi} right]^lambda left[ 1 + (t/gamma)^{phi} right]} ]


begin{figure}[htbp!]
centering
begin{tikzpicture}
begin{axis}[
legend pos=north east,
title = {},
xlabel = {time},
ylabel = {temperature},
xmin = 0, xmax = 15,
ymin = 0, ymax = 8,
xtick = {0, 5, 10, 15},
ytick = {0, 2, 4, 6, 8},
]

addplot[black, no marks, domain=0.01:15, smooth]{(1.86*3.38*(42.2 - 23.3))/(x*(1 + (x/3.15)^(-3.38))^(1.86)*(1 + (x/3.15)^(3.38)))};
addlegendentry{fitted function}

addplot[red, no marks, domain=0.01:15, smooth]{(12*3.01*(43.6 - 23.8))/(x*(1 + (x/1.38)^(-3.01))^(12)*(1 + (x/1.38)^(3.01)))};
addlegendentry{fitted function2}

end{axis}
end{tikzpicture}

end{figure}

end{document}






pgfplots graphics






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 10 mins ago









IlyankorIlyankor

1018




1018













  • Yes, that's what declare function is for.

    – marmot
    3 mins ago











  • @marmot Thank you, but an example please? Also any suggestions for making the graph look better or other options?

    – Ilyankor
    1 min ago





















  • Yes, that's what declare function is for.

    – marmot
    3 mins ago











  • @marmot Thank you, but an example please? Also any suggestions for making the graph look better or other options?

    – Ilyankor
    1 min ago



















Yes, that's what declare function is for.

– marmot
3 mins ago





Yes, that's what declare function is for.

– marmot
3 mins ago













@marmot Thank you, but an example please? Also any suggestions for making the graph look better or other options?

– Ilyankor
1 min ago







@marmot Thank you, but an example please? Also any suggestions for making the graph look better or other options?

– Ilyankor
1 min ago












0






active

oldest

votes











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472176%2fplotting-multiple-functions-in-pgfplots%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472176%2fplotting-multiple-functions-in-pgfplots%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Accessing regular linux commands in Huawei's Dopra Linux

Can't connect RFCOMM socket: Host is down

Kernel panic - not syncing: Fatal Exception in Interrupt