Scaling a graph of a circle and the standard parabola in TikZ
The following code renders the graphs of an arc of a circle and the standard parabola on the Cartesian plane. It is ridiculously small, though. How do I magnify the display, except for the labels on the axes? (I do not want to use pgfplots
.)
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
begin{document}
noindent hspace*{fill}
begin{tikzpicture}
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
draw[fill] (0,1/2) circle (1.5pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
hspace{fill}
end{document}
tikz-pgf
add a comment |
The following code renders the graphs of an arc of a circle and the standard parabola on the Cartesian plane. It is ridiculously small, though. How do I magnify the display, except for the labels on the axes? (I do not want to use pgfplots
.)
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
begin{document}
noindent hspace*{fill}
begin{tikzpicture}
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
draw[fill] (0,1/2) circle (1.5pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
hspace{fill}
end{document}
tikz-pgf
add a comment |
The following code renders the graphs of an arc of a circle and the standard parabola on the Cartesian plane. It is ridiculously small, though. How do I magnify the display, except for the labels on the axes? (I do not want to use pgfplots
.)
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
begin{document}
noindent hspace*{fill}
begin{tikzpicture}
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
draw[fill] (0,1/2) circle (1.5pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
hspace{fill}
end{document}
tikz-pgf
The following code renders the graphs of an arc of a circle and the standard parabola on the Cartesian plane. It is ridiculously small, though. How do I magnify the display, except for the labels on the axes? (I do not want to use pgfplots
.)
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
begin{document}
noindent hspace*{fill}
begin{tikzpicture}
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
draw[fill] (0,1/2) circle (1.5pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
hspace{fill}
end{document}
tikz-pgf
tikz-pgf
asked 14 hours ago
A gal named DesireA gal named Desire
6681411
6681411
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
- I add
scale
option. I thinkscale=5
is appropriate in this case. - I don't use your approach to center figures. I would use
figure
and add a caption as well as a label instead. If you don't want a caption and a label, you should usecenter
environment. - I changed a
draw[fill]
tofill
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt); % Note that it is not 1.5pt
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
Or if you want to have your image automatically resized to textwidth
, have a look at the nice tikzscale
package.
begin{filecontents}{mypic.tikz}
begin{tikzpicture}
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
end{filecontents}
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usepackage{tikzscale}
usepackage[showframe]{geometry}
begin{document}
begin{figure}
centering
includegraphics[width=textwidth]{mypic.tikz}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
[First code improved]
I suggest not using a filled circle for coordinate. A node
is more ok I think. Also a node
is not scaled by scale
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
tikzset{your coordinate/.style={fill=black,inner sep=0.5pt,circle}}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
node[your coordinate] at (0,1/2) {};
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
You can (should) also apply this to the second code. Btw, I think your circle is way too small.
I agree that magnifying by 5 is appropriate. (I see that you had to manually calculate the radius of the dot indicating the center of the circle with thescale
option.)
– A gal named Desire
13 hours ago
What is the advantage of using thefigure
environment? I see that you used that in both codes.
– A gal named Desire
13 hours ago
1
@AgalnamedDesire For comment (2): It is a floating environment, so you can control the position of the environment to the top of the page, the bottom, etc. with floating options. Moreover, you can make a caption and a label, so you can make a reference to the figure (e.g. We have figure 1 so...) later.
– JouleV
13 hours ago
1
@AgalnamedDesire For comment (3) (you are typing so fast :D) No. Unless your TikZ picture is in the shape of a square.
– JouleV
13 hours ago
1
@AgalnamedDesire I edited my answer. Now the radius of the dot is prevented from being scaled.
– JouleV
13 hours ago
|
show 1 more comment
Another option that might help if you want to save scale
for relative scaling and/or are using transform shape
is just to redefine the unit vectors. In this example, this is equivalent to Joule V's suggestion, but in the above-mentioned situations it might be useful to know about this option, too.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[x=5cm,y=5cm]
draw[fill] (0,1/2) circle (1.5pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){$x$};
node[above right] at ($(0,3/4) +(0,12.5pt)$){$y$};
end{tikzpicture}
end{document}
Do the optionsx=5cm, y=5cm
for theTikZ
environment rendercoordinate (center_of_circle) at (0,1/2);
as a point2.5cm
above the origin?
– A gal named Desire
13 hours ago
@AgalnamedDesire Yes, as can be seen from the output.
– marmot
13 hours ago
This is a very short edit to my code to give me the display that I want.
– A gal named Desire
13 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
});
}
});
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%2f484156%2fscaling-a-graph-of-a-circle-and-the-standard-parabola-in-tikz%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
- I add
scale
option. I thinkscale=5
is appropriate in this case. - I don't use your approach to center figures. I would use
figure
and add a caption as well as a label instead. If you don't want a caption and a label, you should usecenter
environment. - I changed a
draw[fill]
tofill
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt); % Note that it is not 1.5pt
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
Or if you want to have your image automatically resized to textwidth
, have a look at the nice tikzscale
package.
begin{filecontents}{mypic.tikz}
begin{tikzpicture}
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
end{filecontents}
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usepackage{tikzscale}
usepackage[showframe]{geometry}
begin{document}
begin{figure}
centering
includegraphics[width=textwidth]{mypic.tikz}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
[First code improved]
I suggest not using a filled circle for coordinate. A node
is more ok I think. Also a node
is not scaled by scale
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
tikzset{your coordinate/.style={fill=black,inner sep=0.5pt,circle}}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
node[your coordinate] at (0,1/2) {};
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
You can (should) also apply this to the second code. Btw, I think your circle is way too small.
I agree that magnifying by 5 is appropriate. (I see that you had to manually calculate the radius of the dot indicating the center of the circle with thescale
option.)
– A gal named Desire
13 hours ago
What is the advantage of using thefigure
environment? I see that you used that in both codes.
– A gal named Desire
13 hours ago
1
@AgalnamedDesire For comment (2): It is a floating environment, so you can control the position of the environment to the top of the page, the bottom, etc. with floating options. Moreover, you can make a caption and a label, so you can make a reference to the figure (e.g. We have figure 1 so...) later.
– JouleV
13 hours ago
1
@AgalnamedDesire For comment (3) (you are typing so fast :D) No. Unless your TikZ picture is in the shape of a square.
– JouleV
13 hours ago
1
@AgalnamedDesire I edited my answer. Now the radius of the dot is prevented from being scaled.
– JouleV
13 hours ago
|
show 1 more comment
- I add
scale
option. I thinkscale=5
is appropriate in this case. - I don't use your approach to center figures. I would use
figure
and add a caption as well as a label instead. If you don't want a caption and a label, you should usecenter
environment. - I changed a
draw[fill]
tofill
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt); % Note that it is not 1.5pt
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
Or if you want to have your image automatically resized to textwidth
, have a look at the nice tikzscale
package.
begin{filecontents}{mypic.tikz}
begin{tikzpicture}
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
end{filecontents}
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usepackage{tikzscale}
usepackage[showframe]{geometry}
begin{document}
begin{figure}
centering
includegraphics[width=textwidth]{mypic.tikz}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
[First code improved]
I suggest not using a filled circle for coordinate. A node
is more ok I think. Also a node
is not scaled by scale
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
tikzset{your coordinate/.style={fill=black,inner sep=0.5pt,circle}}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
node[your coordinate] at (0,1/2) {};
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
You can (should) also apply this to the second code. Btw, I think your circle is way too small.
I agree that magnifying by 5 is appropriate. (I see that you had to manually calculate the radius of the dot indicating the center of the circle with thescale
option.)
– A gal named Desire
13 hours ago
What is the advantage of using thefigure
environment? I see that you used that in both codes.
– A gal named Desire
13 hours ago
1
@AgalnamedDesire For comment (2): It is a floating environment, so you can control the position of the environment to the top of the page, the bottom, etc. with floating options. Moreover, you can make a caption and a label, so you can make a reference to the figure (e.g. We have figure 1 so...) later.
– JouleV
13 hours ago
1
@AgalnamedDesire For comment (3) (you are typing so fast :D) No. Unless your TikZ picture is in the shape of a square.
– JouleV
13 hours ago
1
@AgalnamedDesire I edited my answer. Now the radius of the dot is prevented from being scaled.
– JouleV
13 hours ago
|
show 1 more comment
- I add
scale
option. I thinkscale=5
is appropriate in this case. - I don't use your approach to center figures. I would use
figure
and add a caption as well as a label instead. If you don't want a caption and a label, you should usecenter
environment. - I changed a
draw[fill]
tofill
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt); % Note that it is not 1.5pt
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
Or if you want to have your image automatically resized to textwidth
, have a look at the nice tikzscale
package.
begin{filecontents}{mypic.tikz}
begin{tikzpicture}
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
end{filecontents}
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usepackage{tikzscale}
usepackage[showframe]{geometry}
begin{document}
begin{figure}
centering
includegraphics[width=textwidth]{mypic.tikz}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
[First code improved]
I suggest not using a filled circle for coordinate. A node
is more ok I think. Also a node
is not scaled by scale
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
tikzset{your coordinate/.style={fill=black,inner sep=0.5pt,circle}}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
node[your coordinate] at (0,1/2) {};
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
You can (should) also apply this to the second code. Btw, I think your circle is way too small.
- I add
scale
option. I thinkscale=5
is appropriate in this case. - I don't use your approach to center figures. I would use
figure
and add a caption as well as a label instead. If you don't want a caption and a label, you should usecenter
environment. - I changed a
draw[fill]
tofill
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt); % Note that it is not 1.5pt
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
Or if you want to have your image automatically resized to textwidth
, have a look at the nice tikzscale
package.
begin{filecontents}{mypic.tikz}
begin{tikzpicture}
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
fill (0,1/2) circle (0.3pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
end{filecontents}
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
usepackage{tikzscale}
usepackage[showframe]{geometry}
begin{document}
begin{figure}
centering
includegraphics[width=textwidth]{mypic.tikz}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
[First code improved]
I suggest not using a filled circle for coordinate. A node
is more ok I think. Also a node
is not scaled by scale
.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc,intersections}
tikzset{your coordinate/.style={fill=black,inner sep=0.5pt,circle}}
begin{document}
begin{figure}
centering
begin{tikzpicture}[scale=5]
%An arc of a circle centered at (0, 1/2) and the standard parabola are drawn on the Cartesian plane.
node[your coordinate] at (0,1/2) {};
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){textit{x}};
node[above right] at ($(0,3/4) +(0,12.5pt)$){textit{y}};
end{tikzpicture}
caption{Some caption}
label{fig:tikzfigure}
end{figure}
end{document}
You can (should) also apply this to the second code. Btw, I think your circle is way too small.
edited 13 hours ago
answered 14 hours ago
JouleVJouleV
12.3k22663
12.3k22663
I agree that magnifying by 5 is appropriate. (I see that you had to manually calculate the radius of the dot indicating the center of the circle with thescale
option.)
– A gal named Desire
13 hours ago
What is the advantage of using thefigure
environment? I see that you used that in both codes.
– A gal named Desire
13 hours ago
1
@AgalnamedDesire For comment (2): It is a floating environment, so you can control the position of the environment to the top of the page, the bottom, etc. with floating options. Moreover, you can make a caption and a label, so you can make a reference to the figure (e.g. We have figure 1 so...) later.
– JouleV
13 hours ago
1
@AgalnamedDesire For comment (3) (you are typing so fast :D) No. Unless your TikZ picture is in the shape of a square.
– JouleV
13 hours ago
1
@AgalnamedDesire I edited my answer. Now the radius of the dot is prevented from being scaled.
– JouleV
13 hours ago
|
show 1 more comment
I agree that magnifying by 5 is appropriate. (I see that you had to manually calculate the radius of the dot indicating the center of the circle with thescale
option.)
– A gal named Desire
13 hours ago
What is the advantage of using thefigure
environment? I see that you used that in both codes.
– A gal named Desire
13 hours ago
1
@AgalnamedDesire For comment (2): It is a floating environment, so you can control the position of the environment to the top of the page, the bottom, etc. with floating options. Moreover, you can make a caption and a label, so you can make a reference to the figure (e.g. We have figure 1 so...) later.
– JouleV
13 hours ago
1
@AgalnamedDesire For comment (3) (you are typing so fast :D) No. Unless your TikZ picture is in the shape of a square.
– JouleV
13 hours ago
1
@AgalnamedDesire I edited my answer. Now the radius of the dot is prevented from being scaled.
– JouleV
13 hours ago
I agree that magnifying by 5 is appropriate. (I see that you had to manually calculate the radius of the dot indicating the center of the circle with the
scale
option.)– A gal named Desire
13 hours ago
I agree that magnifying by 5 is appropriate. (I see that you had to manually calculate the radius of the dot indicating the center of the circle with the
scale
option.)– A gal named Desire
13 hours ago
What is the advantage of using the
figure
environment? I see that you used that in both codes.– A gal named Desire
13 hours ago
What is the advantage of using the
figure
environment? I see that you used that in both codes.– A gal named Desire
13 hours ago
1
1
@AgalnamedDesire For comment (2): It is a floating environment, so you can control the position of the environment to the top of the page, the bottom, etc. with floating options. Moreover, you can make a caption and a label, so you can make a reference to the figure (e.g. We have figure 1 so...) later.
– JouleV
13 hours ago
@AgalnamedDesire For comment (2): It is a floating environment, so you can control the position of the environment to the top of the page, the bottom, etc. with floating options. Moreover, you can make a caption and a label, so you can make a reference to the figure (e.g. We have figure 1 so...) later.
– JouleV
13 hours ago
1
1
@AgalnamedDesire For comment (3) (you are typing so fast :D) No. Unless your TikZ picture is in the shape of a square.
– JouleV
13 hours ago
@AgalnamedDesire For comment (3) (you are typing so fast :D) No. Unless your TikZ picture is in the shape of a square.
– JouleV
13 hours ago
1
1
@AgalnamedDesire I edited my answer. Now the radius of the dot is prevented from being scaled.
– JouleV
13 hours ago
@AgalnamedDesire I edited my answer. Now the radius of the dot is prevented from being scaled.
– JouleV
13 hours ago
|
show 1 more comment
Another option that might help if you want to save scale
for relative scaling and/or are using transform shape
is just to redefine the unit vectors. In this example, this is equivalent to Joule V's suggestion, but in the above-mentioned situations it might be useful to know about this option, too.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[x=5cm,y=5cm]
draw[fill] (0,1/2) circle (1.5pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){$x$};
node[above right] at ($(0,3/4) +(0,12.5pt)$){$y$};
end{tikzpicture}
end{document}
Do the optionsx=5cm, y=5cm
for theTikZ
environment rendercoordinate (center_of_circle) at (0,1/2);
as a point2.5cm
above the origin?
– A gal named Desire
13 hours ago
@AgalnamedDesire Yes, as can be seen from the output.
– marmot
13 hours ago
This is a very short edit to my code to give me the display that I want.
– A gal named Desire
13 hours ago
add a comment |
Another option that might help if you want to save scale
for relative scaling and/or are using transform shape
is just to redefine the unit vectors. In this example, this is equivalent to Joule V's suggestion, but in the above-mentioned situations it might be useful to know about this option, too.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[x=5cm,y=5cm]
draw[fill] (0,1/2) circle (1.5pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){$x$};
node[above right] at ($(0,3/4) +(0,12.5pt)$){$y$};
end{tikzpicture}
end{document}
Do the optionsx=5cm, y=5cm
for theTikZ
environment rendercoordinate (center_of_circle) at (0,1/2);
as a point2.5cm
above the origin?
– A gal named Desire
13 hours ago
@AgalnamedDesire Yes, as can be seen from the output.
– marmot
13 hours ago
This is a very short edit to my code to give me the display that I want.
– A gal named Desire
13 hours ago
add a comment |
Another option that might help if you want to save scale
for relative scaling and/or are using transform shape
is just to redefine the unit vectors. In this example, this is equivalent to Joule V's suggestion, but in the above-mentioned situations it might be useful to know about this option, too.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[x=5cm,y=5cm]
draw[fill] (0,1/2) circle (1.5pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){$x$};
node[above right] at ($(0,3/4) +(0,12.5pt)$){$y$};
end{tikzpicture}
end{document}
Another option that might help if you want to save scale
for relative scaling and/or are using transform shape
is just to redefine the unit vectors. In this example, this is equivalent to Joule V's suggestion, but in the above-mentioned situations it might be useful to know about this option, too.
documentclass{amsart}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{tikz}
usetikzlibrary{calc}
begin{document}
begin{tikzpicture}[x=5cm,y=5cm]
draw[fill] (0,1/2) circle (1.5pt);
draw[blue] ($(0,1/2) +(150:1/2)$) arc (150:390:1/2);
draw[domain={-sqrt(3)/2}:{sqrt(3)/2}] plot (x, {x*x});
draw[latex-latex] ($(-12.5pt,0) +({-1/sqrt(2)},0)$) -- ($(12.5pt,0) +({1/sqrt(2)},0)$);
draw[latex-latex] (0,-1/2) -- ($(0,3/4) +(0,12.5pt)$);
node[below right] at ($({1/sqrt(2)}, 0) +(12.5pt,0)$){$x$};
node[above right] at ($(0,3/4) +(0,12.5pt)$){$y$};
end{tikzpicture}
end{document}
answered 13 hours ago
marmotmarmot
117k5150283
117k5150283
Do the optionsx=5cm, y=5cm
for theTikZ
environment rendercoordinate (center_of_circle) at (0,1/2);
as a point2.5cm
above the origin?
– A gal named Desire
13 hours ago
@AgalnamedDesire Yes, as can be seen from the output.
– marmot
13 hours ago
This is a very short edit to my code to give me the display that I want.
– A gal named Desire
13 hours ago
add a comment |
Do the optionsx=5cm, y=5cm
for theTikZ
environment rendercoordinate (center_of_circle) at (0,1/2);
as a point2.5cm
above the origin?
– A gal named Desire
13 hours ago
@AgalnamedDesire Yes, as can be seen from the output.
– marmot
13 hours ago
This is a very short edit to my code to give me the display that I want.
– A gal named Desire
13 hours ago
Do the options
x=5cm, y=5cm
for the TikZ
environment render coordinate (center_of_circle) at (0,1/2);
as a point 2.5cm
above the origin?– A gal named Desire
13 hours ago
Do the options
x=5cm, y=5cm
for the TikZ
environment render coordinate (center_of_circle) at (0,1/2);
as a point 2.5cm
above the origin?– A gal named Desire
13 hours ago
@AgalnamedDesire Yes, as can be seen from the output.
– marmot
13 hours ago
@AgalnamedDesire Yes, as can be seen from the output.
– marmot
13 hours ago
This is a very short edit to my code to give me the display that I want.
– A gal named Desire
13 hours ago
This is a very short edit to my code to give me the display that I want.
– A gal named Desire
13 hours ago
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%2f484156%2fscaling-a-graph-of-a-circle-and-the-standard-parabola-in-tikz%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