Plot a function of two variables equal 0
I would like to plot the function x2(1 − x2) − y2 = 0 in LaTeX.
I tried running following code
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
begin{document}
begin{tikzpicture}
begin{axis}[
view={0}{90},
no markers,
]
addplot3+[
contour gnuplot={
levels=0,
labels=false,
}
]
{x^2(1-x^2)-y^2};
end{axis}
end{tikzpicture}
end{document}
but the output is
But should be
Thanks for helping.
tikz-pgf pgfplots plot gnuplot
New contributor
add a comment |
I would like to plot the function x2(1 − x2) − y2 = 0 in LaTeX.
I tried running following code
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
begin{document}
begin{tikzpicture}
begin{axis}[
view={0}{90},
no markers,
]
addplot3+[
contour gnuplot={
levels=0,
labels=false,
}
]
{x^2(1-x^2)-y^2};
end{axis}
end{tikzpicture}
end{document}
but the output is
But should be
Thanks for helping.
tikz-pgf pgfplots plot gnuplot
New contributor
add a comment |
I would like to plot the function x2(1 − x2) − y2 = 0 in LaTeX.
I tried running following code
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
begin{document}
begin{tikzpicture}
begin{axis}[
view={0}{90},
no markers,
]
addplot3+[
contour gnuplot={
levels=0,
labels=false,
}
]
{x^2(1-x^2)-y^2};
end{axis}
end{tikzpicture}
end{document}
but the output is
But should be
Thanks for helping.
tikz-pgf pgfplots plot gnuplot
New contributor
I would like to plot the function x2(1 − x2) − y2 = 0 in LaTeX.
I tried running following code
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
begin{document}
begin{tikzpicture}
begin{axis}[
view={0}{90},
no markers,
]
addplot3+[
contour gnuplot={
levels=0,
labels=false,
}
]
{x^2(1-x^2)-y^2};
end{axis}
end{tikzpicture}
end{document}
but the output is
But should be
Thanks for helping.
tikz-pgf pgfplots plot gnuplot
tikz-pgf pgfplots plot gnuplot
New contributor
New contributor
edited 12 hours ago
JouleV
5,51121445
5,51121445
New contributor
asked 13 hours ago
Aris Martin AccolaAris Martin Accola
312
312
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
@Superuser27 is correct about the missing *. Additionally, I don't understand why you're using addplot3.
Finally, that's not a function.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
begin{document}
begin{tikzpicture}
begin{axis}[
]
addplot[domain=-1:1,samples=1000]{ sqrt(x*x*(1-x*x)) * -1 };
addplot[domain=-1:1,samples=1000]{ (x*x*(1-x*x))^0.5 * 1 };
draw (axis cs:1,-0.07,1)--(axis cs:1,0.07);
end{axis}
end{tikzpicture}
end{document}
add a comment |
I had some trouble running your code (compatibility issues) but now it should work. I think the answer is simply that you missed a *
in {x^2(1-x^2)-y^2};
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[
view={0}{90},
no markers,
]
addplot3[
contour gnuplot={
levels=0,
labels = false,
},
domain=-2:2,
domain y=-1.3:1.3,
]
{x^2*(1-x^2)-y^2};
end{axis}
end{tikzpicture}
end{document}
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot file{texstudio_Ml6192_contourtmp0.table} could not be opened. {x^2*(1-x^2)-y^2};
. If you have some idea, let me know.
– Raaja
12 hours ago
2
I got the same error. I had to look around online and found that Overleaf also complains but still gives you an output. @Raaja
– Superuser27
12 hours ago
1
Huhhh, I see. Thanks for the update!
– Raaja
12 hours ago
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
12 hours ago
@JohnKormylo Eventhough, as per your comment, I change it tox*x*(1-x*x)-y*y
, I still encounter the same issue.
– Raaja
12 hours ago
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
});
}
});
Aris Martin Accola 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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f479459%2fplot-a-function-of-two-variables-equal-0%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
@Superuser27 is correct about the missing *. Additionally, I don't understand why you're using addplot3.
Finally, that's not a function.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
begin{document}
begin{tikzpicture}
begin{axis}[
]
addplot[domain=-1:1,samples=1000]{ sqrt(x*x*(1-x*x)) * -1 };
addplot[domain=-1:1,samples=1000]{ (x*x*(1-x*x))^0.5 * 1 };
draw (axis cs:1,-0.07,1)--(axis cs:1,0.07);
end{axis}
end{tikzpicture}
end{document}
add a comment |
@Superuser27 is correct about the missing *. Additionally, I don't understand why you're using addplot3.
Finally, that's not a function.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
begin{document}
begin{tikzpicture}
begin{axis}[
]
addplot[domain=-1:1,samples=1000]{ sqrt(x*x*(1-x*x)) * -1 };
addplot[domain=-1:1,samples=1000]{ (x*x*(1-x*x))^0.5 * 1 };
draw (axis cs:1,-0.07,1)--(axis cs:1,0.07);
end{axis}
end{tikzpicture}
end{document}
add a comment |
@Superuser27 is correct about the missing *. Additionally, I don't understand why you're using addplot3.
Finally, that's not a function.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
begin{document}
begin{tikzpicture}
begin{axis}[
]
addplot[domain=-1:1,samples=1000]{ sqrt(x*x*(1-x*x)) * -1 };
addplot[domain=-1:1,samples=1000]{ (x*x*(1-x*x))^0.5 * 1 };
draw (axis cs:1,-0.07,1)--(axis cs:1,0.07);
end{axis}
end{tikzpicture}
end{document}
@Superuser27 is correct about the missing *. Additionally, I don't understand why you're using addplot3.
Finally, that's not a function.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
begin{document}
begin{tikzpicture}
begin{axis}[
]
addplot[domain=-1:1,samples=1000]{ sqrt(x*x*(1-x*x)) * -1 };
addplot[domain=-1:1,samples=1000]{ (x*x*(1-x*x))^0.5 * 1 };
draw (axis cs:1,-0.07,1)--(axis cs:1,0.07);
end{axis}
end{tikzpicture}
end{document}
answered 12 hours ago
JPiJPi
9,81421550
9,81421550
add a comment |
add a comment |
I had some trouble running your code (compatibility issues) but now it should work. I think the answer is simply that you missed a *
in {x^2(1-x^2)-y^2};
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[
view={0}{90},
no markers,
]
addplot3[
contour gnuplot={
levels=0,
labels = false,
},
domain=-2:2,
domain y=-1.3:1.3,
]
{x^2*(1-x^2)-y^2};
end{axis}
end{tikzpicture}
end{document}
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot file{texstudio_Ml6192_contourtmp0.table} could not be opened. {x^2*(1-x^2)-y^2};
. If you have some idea, let me know.
– Raaja
12 hours ago
2
I got the same error. I had to look around online and found that Overleaf also complains but still gives you an output. @Raaja
– Superuser27
12 hours ago
1
Huhhh, I see. Thanks for the update!
– Raaja
12 hours ago
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
12 hours ago
@JohnKormylo Eventhough, as per your comment, I change it tox*x*(1-x*x)-y*y
, I still encounter the same issue.
– Raaja
12 hours ago
add a comment |
I had some trouble running your code (compatibility issues) but now it should work. I think the answer is simply that you missed a *
in {x^2(1-x^2)-y^2};
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[
view={0}{90},
no markers,
]
addplot3[
contour gnuplot={
levels=0,
labels = false,
},
domain=-2:2,
domain y=-1.3:1.3,
]
{x^2*(1-x^2)-y^2};
end{axis}
end{tikzpicture}
end{document}
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot file{texstudio_Ml6192_contourtmp0.table} could not be opened. {x^2*(1-x^2)-y^2};
. If you have some idea, let me know.
– Raaja
12 hours ago
2
I got the same error. I had to look around online and found that Overleaf also complains but still gives you an output. @Raaja
– Superuser27
12 hours ago
1
Huhhh, I see. Thanks for the update!
– Raaja
12 hours ago
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
12 hours ago
@JohnKormylo Eventhough, as per your comment, I change it tox*x*(1-x*x)-y*y
, I still encounter the same issue.
– Raaja
12 hours ago
add a comment |
I had some trouble running your code (compatibility issues) but now it should work. I think the answer is simply that you missed a *
in {x^2(1-x^2)-y^2};
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[
view={0}{90},
no markers,
]
addplot3[
contour gnuplot={
levels=0,
labels = false,
},
domain=-2:2,
domain y=-1.3:1.3,
]
{x^2*(1-x^2)-y^2};
end{axis}
end{tikzpicture}
end{document}
I had some trouble running your code (compatibility issues) but now it should work. I think the answer is simply that you missed a *
in {x^2(1-x^2)-y^2};
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage[utf8]{inputenc}
usepackage{textcomp}
usepackage{pgfplots}
pgfplotsset{width=10cm}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[
view={0}{90},
no markers,
]
addplot3[
contour gnuplot={
levels=0,
labels = false,
},
domain=-2:2,
domain y=-1.3:1.3,
]
{x^2*(1-x^2)-y^2};
end{axis}
end{tikzpicture}
end{document}
answered 12 hours ago
Superuser27Superuser27
61715
61715
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot file{texstudio_Ml6192_contourtmp0.table} could not be opened. {x^2*(1-x^2)-y^2};
. If you have some idea, let me know.
– Raaja
12 hours ago
2
I got the same error. I had to look around online and found that Overleaf also complains but still gives you an output. @Raaja
– Superuser27
12 hours ago
1
Huhhh, I see. Thanks for the update!
– Raaja
12 hours ago
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
12 hours ago
@JohnKormylo Eventhough, as per your comment, I change it tox*x*(1-x*x)-y*y
, I still encounter the same issue.
– Raaja
12 hours ago
add a comment |
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot file{texstudio_Ml6192_contourtmp0.table} could not be opened. {x^2*(1-x^2)-y^2};
. If you have some idea, let me know.
– Raaja
12 hours ago
2
I got the same error. I had to look around online and found that Overleaf also complains but still gives you an output. @Raaja
– Superuser27
12 hours ago
1
Huhhh, I see. Thanks for the update!
– Raaja
12 hours ago
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
12 hours ago
@JohnKormylo Eventhough, as per your comment, I change it tox*x*(1-x*x)-y*y
, I still encounter the same issue.
– Raaja
12 hours ago
how did you manage to compile it, I am having hard-time compiling it with the error being:
Package pgfplots Error: sorry, plot file{texstudio_Ml6192_contourtmp0.table} could not be opened. {x^2*(1-x^2)-y^2};
. If you have some idea, let me know.– Raaja
12 hours ago
how did you manage to compile it, I am having hard-time compiling it with the error being:
Package pgfplots Error: sorry, plot file{texstudio_Ml6192_contourtmp0.table} could not be opened. {x^2*(1-x^2)-y^2};
. If you have some idea, let me know.– Raaja
12 hours ago
2
2
I got the same error. I had to look around online and found that Overleaf also complains but still gives you an output. @Raaja
– Superuser27
12 hours ago
I got the same error. I had to look around online and found that Overleaf also complains but still gives you an output. @Raaja
– Superuser27
12 hours ago
1
1
Huhhh, I see. Thanks for the update!
– Raaja
12 hours ago
Huhhh, I see. Thanks for the update!
– Raaja
12 hours ago
2
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
12 hours ago
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
12 hours ago
@JohnKormylo Eventhough, as per your comment, I change it to
x*x*(1-x*x)-y*y
, I still encounter the same issue.– Raaja
12 hours ago
@JohnKormylo Eventhough, as per your comment, I change it to
x*x*(1-x*x)-y*y
, I still encounter the same issue.– Raaja
12 hours ago
add a comment |
Aris Martin Accola is a new contributor. Be nice, and check out our Code of Conduct.
Aris Martin Accola is a new contributor. Be nice, and check out our Code of Conduct.
Aris Martin Accola is a new contributor. Be nice, and check out our Code of Conduct.
Aris Martin Accola is a new contributor. Be nice, and check out our Code of Conduct.
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%2f479459%2fplot-a-function-of-two-variables-equal-0%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