Plot a function of two variables equal 0
Clash Royale CLAN TAG#URR8PPP
I would like to plot the function x2(1 − x2) − y2 = 0 in LaTeX.
I tried running following code
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
begindocument
begintikzpicture
beginaxis[
view=090,
no markers,
]
addplot3+[
contour gnuplot=
levels=0,
labels=false,
]
x^2(1-x^2)-y^2;
endaxis
endtikzpicture
enddocument
but the output is
But should be
Thanks for helping.
tikz-pgf pgfplots plot gnuplot
add a comment |
I would like to plot the function x2(1 − x2) − y2 = 0 in LaTeX.
I tried running following code
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
begindocument
begintikzpicture
beginaxis[
view=090,
no markers,
]
addplot3+[
contour gnuplot=
levels=0,
labels=false,
]
x^2(1-x^2)-y^2;
endaxis
endtikzpicture
enddocument
but the output is
But should be
Thanks for helping.
tikz-pgf pgfplots plot gnuplot
add a comment |
I would like to plot the function x2(1 − x2) − y2 = 0 in LaTeX.
I tried running following code
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
begindocument
begintikzpicture
beginaxis[
view=090,
no markers,
]
addplot3+[
contour gnuplot=
levels=0,
labels=false,
]
x^2(1-x^2)-y^2;
endaxis
endtikzpicture
enddocument
but the output is
But should be
Thanks for helping.
tikz-pgf pgfplots plot gnuplot
I would like to plot the function x2(1 − x2) − y2 = 0 in LaTeX.
I tried running following code
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
begindocument
begintikzpicture
beginaxis[
view=090,
no markers,
]
addplot3+[
contour gnuplot=
levels=0,
labels=false,
]
x^2(1-x^2)-y^2;
endaxis
endtikzpicture
enddocument
but the output is
But should be
Thanks for helping.
tikz-pgf pgfplots plot gnuplot
tikz-pgf pgfplots plot gnuplot
edited Mar 14 at 13:08
JouleV
13k22663
13k22663
asked Mar 14 at 12:24
Aris Martin AccolaAris Martin Accola
363
363
add a comment |
add a comment |
3 Answers
3
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.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
begindocument
begintikzpicture
beginaxis[
]
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);
endaxis
endtikzpicture
enddocument
I used addplot for the contour gnuplot. So i don‘t have to calculate the function equal 0 for y.
– Aris Martin Accola
Mar 15 at 14:44
add a comment |
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
]
addplot[no marks,variable=t,domain=0:360,samples=100] (cos(t), 0.5*sin(2*t));
endaxis
endtikzpicture
enddocument
Best answer....
– JPi
Mar 17 at 21:51
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;
.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
pgfplotssetcompat=1.15
begindocument
begintikzpicture
beginaxis[
view=090,
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;
endaxis
endtikzpicture
enddocument
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot filetexstudio_Ml6192_contourtmp0.table could not be opened. x^2*(1-x^2)-y^2;
. If you have some idea, let me know.
– Raaja
Mar 14 at 13:24
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
Mar 14 at 13:27
1
Huhhh, I see. Thanks for the update!
– Raaja
Mar 14 at 13:28
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
Mar 14 at 13:55
1
@Raaja I had the same problem first compiling it on my computer. So make sure you have installed gnuplot on your computer and then you need to add it to your path so that the program can find gnuplot. You also need to enable —shell-escape.
– Aris Martin Accola
Mar 15 at 14:41
|
show 1 more 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%2f479459%2fplot-a-function-of-two-variables-equal-0%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
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.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
begindocument
begintikzpicture
beginaxis[
]
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);
endaxis
endtikzpicture
enddocument
I used addplot for the contour gnuplot. So i don‘t have to calculate the function equal 0 for y.
– Aris Martin Accola
Mar 15 at 14:44
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.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
begindocument
begintikzpicture
beginaxis[
]
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);
endaxis
endtikzpicture
enddocument
I used addplot for the contour gnuplot. So i don‘t have to calculate the function equal 0 for y.
– Aris Martin Accola
Mar 15 at 14:44
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.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
begindocument
begintikzpicture
beginaxis[
]
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);
endaxis
endtikzpicture
enddocument
@Superuser27 is correct about the missing *. Additionally, I don't understand why you're using addplot3.
Finally, that's not a function.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
begindocument
begintikzpicture
beginaxis[
]
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);
endaxis
endtikzpicture
enddocument
answered Mar 14 at 13:17
JPiJPi
10.1k21551
10.1k21551
I used addplot for the contour gnuplot. So i don‘t have to calculate the function equal 0 for y.
– Aris Martin Accola
Mar 15 at 14:44
add a comment |
I used addplot for the contour gnuplot. So i don‘t have to calculate the function equal 0 for y.
– Aris Martin Accola
Mar 15 at 14:44
I used addplot for the contour gnuplot. So i don‘t have to calculate the function equal 0 for y.
– Aris Martin Accola
Mar 15 at 14:44
I used addplot for the contour gnuplot. So i don‘t have to calculate the function equal 0 for y.
– Aris Martin Accola
Mar 15 at 14:44
add a comment |
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
]
addplot[no marks,variable=t,domain=0:360,samples=100] (cos(t), 0.5*sin(2*t));
endaxis
endtikzpicture
enddocument
Best answer....
– JPi
Mar 17 at 21:51
add a comment |
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
]
addplot[no marks,variable=t,domain=0:360,samples=100] (cos(t), 0.5*sin(2*t));
endaxis
endtikzpicture
enddocument
Best answer....
– JPi
Mar 17 at 21:51
add a comment |
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
]
addplot[no marks,variable=t,domain=0:360,samples=100] (cos(t), 0.5*sin(2*t));
endaxis
endtikzpicture
enddocument
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[
]
addplot[no marks,variable=t,domain=0:360,samples=100] (cos(t), 0.5*sin(2*t));
endaxis
endtikzpicture
enddocument
edited Mar 18 at 5:40
answered Mar 17 at 21:46
John KormyloJohn Kormylo
46.7k22672
46.7k22672
Best answer....
– JPi
Mar 17 at 21:51
add a comment |
Best answer....
– JPi
Mar 17 at 21:51
Best answer....
– JPi
Mar 17 at 21:51
Best answer....
– JPi
Mar 17 at 21:51
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;
.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
pgfplotssetcompat=1.15
begindocument
begintikzpicture
beginaxis[
view=090,
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;
endaxis
endtikzpicture
enddocument
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot filetexstudio_Ml6192_contourtmp0.table could not be opened. x^2*(1-x^2)-y^2;
. If you have some idea, let me know.
– Raaja
Mar 14 at 13:24
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
Mar 14 at 13:27
1
Huhhh, I see. Thanks for the update!
– Raaja
Mar 14 at 13:28
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
Mar 14 at 13:55
1
@Raaja I had the same problem first compiling it on my computer. So make sure you have installed gnuplot on your computer and then you need to add it to your path so that the program can find gnuplot. You also need to enable —shell-escape.
– Aris Martin Accola
Mar 15 at 14:41
|
show 1 more 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;
.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
pgfplotssetcompat=1.15
begindocument
begintikzpicture
beginaxis[
view=090,
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;
endaxis
endtikzpicture
enddocument
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot filetexstudio_Ml6192_contourtmp0.table could not be opened. x^2*(1-x^2)-y^2;
. If you have some idea, let me know.
– Raaja
Mar 14 at 13:24
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
Mar 14 at 13:27
1
Huhhh, I see. Thanks for the update!
– Raaja
Mar 14 at 13:28
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
Mar 14 at 13:55
1
@Raaja I had the same problem first compiling it on my computer. So make sure you have installed gnuplot on your computer and then you need to add it to your path so that the program can find gnuplot. You also need to enable —shell-escape.
– Aris Martin Accola
Mar 15 at 14:41
|
show 1 more 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;
.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
pgfplotssetcompat=1.15
begindocument
begintikzpicture
beginaxis[
view=090,
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;
endaxis
endtikzpicture
enddocument
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;
.
documentclassarticle
usepackage[margin=0.5in]geometry
usepackage[utf8]inputenc
usepackagetextcomp
usepackagepgfplots
pgfplotssetwidth=10cm
pgfplotssetcompat=1.15
begindocument
begintikzpicture
beginaxis[
view=090,
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;
endaxis
endtikzpicture
enddocument
answered Mar 14 at 13:07
Superuser27Superuser27
90816
90816
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot filetexstudio_Ml6192_contourtmp0.table could not be opened. x^2*(1-x^2)-y^2;
. If you have some idea, let me know.
– Raaja
Mar 14 at 13:24
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
Mar 14 at 13:27
1
Huhhh, I see. Thanks for the update!
– Raaja
Mar 14 at 13:28
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
Mar 14 at 13:55
1
@Raaja I had the same problem first compiling it on my computer. So make sure you have installed gnuplot on your computer and then you need to add it to your path so that the program can find gnuplot. You also need to enable —shell-escape.
– Aris Martin Accola
Mar 15 at 14:41
|
show 1 more comment
how did you manage to compile it, I am having hard-time compiling it with the error being:Package pgfplots Error: sorry, plot filetexstudio_Ml6192_contourtmp0.table could not be opened. x^2*(1-x^2)-y^2;
. If you have some idea, let me know.
– Raaja
Mar 14 at 13:24
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
Mar 14 at 13:27
1
Huhhh, I see. Thanks for the update!
– Raaja
Mar 14 at 13:28
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
Mar 14 at 13:55
1
@Raaja I had the same problem first compiling it on my computer. So make sure you have installed gnuplot on your computer and then you need to add it to your path so that the program can find gnuplot. You also need to enable —shell-escape.
– Aris Martin Accola
Mar 15 at 14:41
how did you manage to compile it, I am having hard-time compiling it with the error being:
Package pgfplots Error: sorry, plot filetexstudio_Ml6192_contourtmp0.table could not be opened. x^2*(1-x^2)-y^2;
. If you have some idea, let me know.– Raaja
Mar 14 at 13:24
how did you manage to compile it, I am having hard-time compiling it with the error being:
Package pgfplots Error: sorry, plot filetexstudio_Ml6192_contourtmp0.table could not be opened. x^2*(1-x^2)-y^2;
. If you have some idea, let me know.– Raaja
Mar 14 at 13:24
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
Mar 14 at 13:27
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
Mar 14 at 13:27
1
1
Huhhh, I see. Thanks for the update!
– Raaja
Mar 14 at 13:28
Huhhh, I see. Thanks for the update!
– Raaja
Mar 14 at 13:28
2
2
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
Mar 14 at 13:55
Usually x^2 is implemented using exp(2*log(x)) which can't handle negative numbers.
– John Kormylo
Mar 14 at 13:55
1
1
@Raaja I had the same problem first compiling it on my computer. So make sure you have installed gnuplot on your computer and then you need to add it to your path so that the program can find gnuplot. You also need to enable —shell-escape.
– Aris Martin Accola
Mar 15 at 14:41
@Raaja I had the same problem first compiling it on my computer. So make sure you have installed gnuplot on your computer and then you need to add it to your path so that the program can find gnuplot. You also need to enable —shell-escape.
– Aris Martin Accola
Mar 15 at 14:41
|
show 1 more 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%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