Graphing sqrt function: not coming out properly
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have been looking at other posts and have modified my code accordingly, but I still can't get it to work. I think there is an issue that has not been addressed in any of the posts that I have found. However, I don't know what the issue is, so I can't make a specific inquiry.
begintikzpicture
beginaxis[xmax = 4,ymax = 3,samples = 50]
draw[black, smooth, variable=x] plot (x,sqrt(1 - 4(x - frac12)^2);
endaxis
endtikzpicture
tikz-pgf plot
New contributor
add a comment |Â
up vote
1
down vote
favorite
I have been looking at other posts and have modified my code accordingly, but I still can't get it to work. I think there is an issue that has not been addressed in any of the posts that I have found. However, I don't know what the issue is, so I can't make a specific inquiry.
begintikzpicture
beginaxis[xmax = 4,ymax = 3,samples = 50]
draw[black, smooth, variable=x] plot (x,sqrt(1 - 4(x - frac12)^2);
endaxis
endtikzpicture
tikz-pgf plot
New contributor
1
Welcome to TeX.SE! If you go this way, thex
must be ax
, i.e.draw[black, smooth, variable=x] plot (x,sqrt(1 - 4*(x - 1/2)^2);
, and you may want to add an appropriate domain. However, since you seem to use pgfplots, useaddplot sqrt(1-4*(x-1/2)^2);
.
â marmot
4 hours ago
Thanks, marmot! Are you referring to the the x within the square root function?
â Rafael Vergnaud
4 hours ago
I see. May you clarify what you mean by appropriate domain?
â Rafael Vergnaud
4 hours ago
The build is saying the following: You can an axis with empty range (in the y direction)
â Rafael Vergnaud
4 hours ago
I have to say, it doesn't come out very nicely. Would you help me make a graph (sorry to be pestering, haha)?
â Rafael Vergnaud
4 hours ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have been looking at other posts and have modified my code accordingly, but I still can't get it to work. I think there is an issue that has not been addressed in any of the posts that I have found. However, I don't know what the issue is, so I can't make a specific inquiry.
begintikzpicture
beginaxis[xmax = 4,ymax = 3,samples = 50]
draw[black, smooth, variable=x] plot (x,sqrt(1 - 4(x - frac12)^2);
endaxis
endtikzpicture
tikz-pgf plot
New contributor
I have been looking at other posts and have modified my code accordingly, but I still can't get it to work. I think there is an issue that has not been addressed in any of the posts that I have found. However, I don't know what the issue is, so I can't make a specific inquiry.
begintikzpicture
beginaxis[xmax = 4,ymax = 3,samples = 50]
draw[black, smooth, variable=x] plot (x,sqrt(1 - 4(x - frac12)^2);
endaxis
endtikzpicture
tikz-pgf plot
tikz-pgf plot
New contributor
New contributor
New contributor
asked 4 hours ago
Rafael Vergnaud
61
61
New contributor
New contributor
1
Welcome to TeX.SE! If you go this way, thex
must be ax
, i.e.draw[black, smooth, variable=x] plot (x,sqrt(1 - 4*(x - 1/2)^2);
, and you may want to add an appropriate domain. However, since you seem to use pgfplots, useaddplot sqrt(1-4*(x-1/2)^2);
.
â marmot
4 hours ago
Thanks, marmot! Are you referring to the the x within the square root function?
â Rafael Vergnaud
4 hours ago
I see. May you clarify what you mean by appropriate domain?
â Rafael Vergnaud
4 hours ago
The build is saying the following: You can an axis with empty range (in the y direction)
â Rafael Vergnaud
4 hours ago
I have to say, it doesn't come out very nicely. Would you help me make a graph (sorry to be pestering, haha)?
â Rafael Vergnaud
4 hours ago
add a comment |Â
1
Welcome to TeX.SE! If you go this way, thex
must be ax
, i.e.draw[black, smooth, variable=x] plot (x,sqrt(1 - 4*(x - 1/2)^2);
, and you may want to add an appropriate domain. However, since you seem to use pgfplots, useaddplot sqrt(1-4*(x-1/2)^2);
.
â marmot
4 hours ago
Thanks, marmot! Are you referring to the the x within the square root function?
â Rafael Vergnaud
4 hours ago
I see. May you clarify what you mean by appropriate domain?
â Rafael Vergnaud
4 hours ago
The build is saying the following: You can an axis with empty range (in the y direction)
â Rafael Vergnaud
4 hours ago
I have to say, it doesn't come out very nicely. Would you help me make a graph (sorry to be pestering, haha)?
â Rafael Vergnaud
4 hours ago
1
1
Welcome to TeX.SE! If you go this way, the
x
must be a x
, i.e. draw[black, smooth, variable=x] plot (x,sqrt(1 - 4*(x - 1/2)^2);
, and you may want to add an appropriate domain. However, since you seem to use pgfplots, use addplot sqrt(1-4*(x-1/2)^2);
.â marmot
4 hours ago
Welcome to TeX.SE! If you go this way, the
x
must be a x
, i.e. draw[black, smooth, variable=x] plot (x,sqrt(1 - 4*(x - 1/2)^2);
, and you may want to add an appropriate domain. However, since you seem to use pgfplots, use addplot sqrt(1-4*(x-1/2)^2);
.â marmot
4 hours ago
Thanks, marmot! Are you referring to the the x within the square root function?
â Rafael Vergnaud
4 hours ago
Thanks, marmot! Are you referring to the the x within the square root function?
â Rafael Vergnaud
4 hours ago
I see. May you clarify what you mean by appropriate domain?
â Rafael Vergnaud
4 hours ago
I see. May you clarify what you mean by appropriate domain?
â Rafael Vergnaud
4 hours ago
The build is saying the following: You can an axis with empty range (in the y direction)
â Rafael Vergnaud
4 hours ago
The build is saying the following: You can an axis with empty range (in the y direction)
â Rafael Vergnaud
4 hours ago
I have to say, it doesn't come out very nicely. Would you help me make a graph (sorry to be pestering, haha)?
â Rafael Vergnaud
4 hours ago
I have to say, it doesn't come out very nicely. Would you help me make a graph (sorry to be pestering, haha)?
â Rafael Vergnaud
4 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
6
down vote
OK, this is too long for a comment. There are several issues:
- You say
variable=x
but onex
does not have a backslash. - You need to add multiplication signs.
- You cannot use
frac
in an expression that is going to be parsed.frac
is used to typeset fractions.
Altogether, the expression should be (I guess) sqrt(1 - 4*(x - 1/2)^2
. However, as you are using an axis
environment, I think you are loading pgfplots
, so I'd suggest
documentclass[tikz,border=3.14mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
begintikzpicture
beginaxis[xmax = 4,ymax = 3,samples = 50]
addplot[black, smooth,domain=0:1] sqrt(1 - 4*(x - 1/2)^2;
endaxis
endtikzpicture
enddocument
Thank you very much marmot! I appreciate your help. :)
â Rafael Vergnaud
3 hours ago
My very last question, which should be brief to answer, is how do I move the plot from the left margin of the pdf to the center of pdf?
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud This is due toxmax = 4,ymax = 3,
. If you drop these, the plot is centered, and also if you makexmin
and so on symmetric around the center.
â marmot
3 hours ago
Hey marmot! I mean on the pdf document. I did switch ymax to 4! Adding xmin did not center the plot of the pdf! It is still on the left hand margin of the pdf. If it's a hassle, I'll just leave it. It's no big deal!
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud The above document is standalone, so I thought you want to center the curve. If you want to center the plot in a figure in an article document, say, you could use centering.
â marmot
3 hours ago
add a comment |Â
up vote
3
down vote
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[xmax=10,ymax=10, samples=1000]
addplot+[mark=none,samples=200,unbounded coords=jump] sqrt(x);
endaxis
endtikzpicture
enddocument
I would suggest to do something like this
New contributor
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
OK, this is too long for a comment. There are several issues:
- You say
variable=x
but onex
does not have a backslash. - You need to add multiplication signs.
- You cannot use
frac
in an expression that is going to be parsed.frac
is used to typeset fractions.
Altogether, the expression should be (I guess) sqrt(1 - 4*(x - 1/2)^2
. However, as you are using an axis
environment, I think you are loading pgfplots
, so I'd suggest
documentclass[tikz,border=3.14mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
begintikzpicture
beginaxis[xmax = 4,ymax = 3,samples = 50]
addplot[black, smooth,domain=0:1] sqrt(1 - 4*(x - 1/2)^2;
endaxis
endtikzpicture
enddocument
Thank you very much marmot! I appreciate your help. :)
â Rafael Vergnaud
3 hours ago
My very last question, which should be brief to answer, is how do I move the plot from the left margin of the pdf to the center of pdf?
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud This is due toxmax = 4,ymax = 3,
. If you drop these, the plot is centered, and also if you makexmin
and so on symmetric around the center.
â marmot
3 hours ago
Hey marmot! I mean on the pdf document. I did switch ymax to 4! Adding xmin did not center the plot of the pdf! It is still on the left hand margin of the pdf. If it's a hassle, I'll just leave it. It's no big deal!
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud The above document is standalone, so I thought you want to center the curve. If you want to center the plot in a figure in an article document, say, you could use centering.
â marmot
3 hours ago
add a comment |Â
up vote
6
down vote
OK, this is too long for a comment. There are several issues:
- You say
variable=x
but onex
does not have a backslash. - You need to add multiplication signs.
- You cannot use
frac
in an expression that is going to be parsed.frac
is used to typeset fractions.
Altogether, the expression should be (I guess) sqrt(1 - 4*(x - 1/2)^2
. However, as you are using an axis
environment, I think you are loading pgfplots
, so I'd suggest
documentclass[tikz,border=3.14mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
begintikzpicture
beginaxis[xmax = 4,ymax = 3,samples = 50]
addplot[black, smooth,domain=0:1] sqrt(1 - 4*(x - 1/2)^2;
endaxis
endtikzpicture
enddocument
Thank you very much marmot! I appreciate your help. :)
â Rafael Vergnaud
3 hours ago
My very last question, which should be brief to answer, is how do I move the plot from the left margin of the pdf to the center of pdf?
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud This is due toxmax = 4,ymax = 3,
. If you drop these, the plot is centered, and also if you makexmin
and so on symmetric around the center.
â marmot
3 hours ago
Hey marmot! I mean on the pdf document. I did switch ymax to 4! Adding xmin did not center the plot of the pdf! It is still on the left hand margin of the pdf. If it's a hassle, I'll just leave it. It's no big deal!
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud The above document is standalone, so I thought you want to center the curve. If you want to center the plot in a figure in an article document, say, you could use centering.
â marmot
3 hours ago
add a comment |Â
up vote
6
down vote
up vote
6
down vote
OK, this is too long for a comment. There are several issues:
- You say
variable=x
but onex
does not have a backslash. - You need to add multiplication signs.
- You cannot use
frac
in an expression that is going to be parsed.frac
is used to typeset fractions.
Altogether, the expression should be (I guess) sqrt(1 - 4*(x - 1/2)^2
. However, as you are using an axis
environment, I think you are loading pgfplots
, so I'd suggest
documentclass[tikz,border=3.14mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
begintikzpicture
beginaxis[xmax = 4,ymax = 3,samples = 50]
addplot[black, smooth,domain=0:1] sqrt(1 - 4*(x - 1/2)^2;
endaxis
endtikzpicture
enddocument
OK, this is too long for a comment. There are several issues:
- You say
variable=x
but onex
does not have a backslash. - You need to add multiplication signs.
- You cannot use
frac
in an expression that is going to be parsed.frac
is used to typeset fractions.
Altogether, the expression should be (I guess) sqrt(1 - 4*(x - 1/2)^2
. However, as you are using an axis
environment, I think you are loading pgfplots
, so I'd suggest
documentclass[tikz,border=3.14mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.16
begindocument
begintikzpicture
beginaxis[xmax = 4,ymax = 3,samples = 50]
addplot[black, smooth,domain=0:1] sqrt(1 - 4*(x - 1/2)^2;
endaxis
endtikzpicture
enddocument
answered 4 hours ago
marmot
72.4k477153
72.4k477153
Thank you very much marmot! I appreciate your help. :)
â Rafael Vergnaud
3 hours ago
My very last question, which should be brief to answer, is how do I move the plot from the left margin of the pdf to the center of pdf?
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud This is due toxmax = 4,ymax = 3,
. If you drop these, the plot is centered, and also if you makexmin
and so on symmetric around the center.
â marmot
3 hours ago
Hey marmot! I mean on the pdf document. I did switch ymax to 4! Adding xmin did not center the plot of the pdf! It is still on the left hand margin of the pdf. If it's a hassle, I'll just leave it. It's no big deal!
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud The above document is standalone, so I thought you want to center the curve. If you want to center the plot in a figure in an article document, say, you could use centering.
â marmot
3 hours ago
add a comment |Â
Thank you very much marmot! I appreciate your help. :)
â Rafael Vergnaud
3 hours ago
My very last question, which should be brief to answer, is how do I move the plot from the left margin of the pdf to the center of pdf?
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud This is due toxmax = 4,ymax = 3,
. If you drop these, the plot is centered, and also if you makexmin
and so on symmetric around the center.
â marmot
3 hours ago
Hey marmot! I mean on the pdf document. I did switch ymax to 4! Adding xmin did not center the plot of the pdf! It is still on the left hand margin of the pdf. If it's a hassle, I'll just leave it. It's no big deal!
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud The above document is standalone, so I thought you want to center the curve. If you want to center the plot in a figure in an article document, say, you could use centering.
â marmot
3 hours ago
Thank you very much marmot! I appreciate your help. :)
â Rafael Vergnaud
3 hours ago
Thank you very much marmot! I appreciate your help. :)
â Rafael Vergnaud
3 hours ago
My very last question, which should be brief to answer, is how do I move the plot from the left margin of the pdf to the center of pdf?
â Rafael Vergnaud
3 hours ago
My very last question, which should be brief to answer, is how do I move the plot from the left margin of the pdf to the center of pdf?
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud This is due to
xmax = 4,ymax = 3,
. If you drop these, the plot is centered, and also if you make xmin
and so on symmetric around the center.â marmot
3 hours ago
@RafaelVergnaud This is due to
xmax = 4,ymax = 3,
. If you drop these, the plot is centered, and also if you make xmin
and so on symmetric around the center.â marmot
3 hours ago
Hey marmot! I mean on the pdf document. I did switch ymax to 4! Adding xmin did not center the plot of the pdf! It is still on the left hand margin of the pdf. If it's a hassle, I'll just leave it. It's no big deal!
â Rafael Vergnaud
3 hours ago
Hey marmot! I mean on the pdf document. I did switch ymax to 4! Adding xmin did not center the plot of the pdf! It is still on the left hand margin of the pdf. If it's a hassle, I'll just leave it. It's no big deal!
â Rafael Vergnaud
3 hours ago
@RafaelVergnaud The above document is standalone, so I thought you want to center the curve. If you want to center the plot in a figure in an article document, say, you could use centering.
â marmot
3 hours ago
@RafaelVergnaud The above document is standalone, so I thought you want to center the curve. If you want to center the plot in a figure in an article document, say, you could use centering.
â marmot
3 hours ago
add a comment |Â
up vote
3
down vote
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[xmax=10,ymax=10, samples=1000]
addplot+[mark=none,samples=200,unbounded coords=jump] sqrt(x);
endaxis
endtikzpicture
enddocument
I would suggest to do something like this
New contributor
add a comment |Â
up vote
3
down vote
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[xmax=10,ymax=10, samples=1000]
addplot+[mark=none,samples=200,unbounded coords=jump] sqrt(x);
endaxis
endtikzpicture
enddocument
I would suggest to do something like this
New contributor
add a comment |Â
up vote
3
down vote
up vote
3
down vote
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[xmax=10,ymax=10, samples=1000]
addplot+[mark=none,samples=200,unbounded coords=jump] sqrt(x);
endaxis
endtikzpicture
enddocument
I would suggest to do something like this
New contributor
documentclassstandalone
usepackagepgfplots
begindocument
begintikzpicture
beginaxis[xmax=10,ymax=10, samples=1000]
addplot+[mark=none,samples=200,unbounded coords=jump] sqrt(x);
endaxis
endtikzpicture
enddocument
I would suggest to do something like this
New contributor
New contributor
answered 3 hours ago
user66094
332
332
New contributor
New contributor
add a comment |Â
add a comment |Â
Rafael Vergnaud is a new contributor. Be nice, and check out our Code of Conduct.
Rafael Vergnaud is a new contributor. Be nice, and check out our Code of Conduct.
Rafael Vergnaud is a new contributor. Be nice, and check out our Code of Conduct.
Rafael Vergnaud 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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f458835%2fgraphing-sqrt-function-not-coming-out-properly%23new-answer', 'question_page');
);
Post as a guest
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
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
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
1
Welcome to TeX.SE! If you go this way, the
x
must be ax
, i.e.draw[black, smooth, variable=x] plot (x,sqrt(1 - 4*(x - 1/2)^2);
, and you may want to add an appropriate domain. However, since you seem to use pgfplots, useaddplot sqrt(1-4*(x-1/2)^2);
.â marmot
4 hours ago
Thanks, marmot! Are you referring to the the x within the square root function?
â Rafael Vergnaud
4 hours ago
I see. May you clarify what you mean by appropriate domain?
â Rafael Vergnaud
4 hours ago
The build is saying the following: You can an axis with empty range (in the y direction)
â Rafael Vergnaud
4 hours ago
I have to say, it doesn't come out very nicely. Would you help me make a graph (sorry to be pestering, haha)?
â Rafael Vergnaud
4 hours ago