How to get the two pictures alignedRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Computing the rectangle encompassing a node and a pointNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionAdjusting edge alignment and positioning of fitted nodeDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themUsing fit with nodepartsUsing tikz Calc package to add cordinates
Grid/table with lots of buttons
How do professional electronic musicians/sound engineers combat listening fatigue?
What exactly makes a General Products hull nearly indestructible?
Why are off grid solar setups only 12, 24, 48 VDC?
Automatic Habit of Meditation
What are the exact meanings of roll, pitch and yaw?
Do the licences permit GPL- and BSD-licensed applications to be used for government work?
How do I run a game when my PCs have different approaches to combat?
How were the LM astronauts supported during the moon landing and ascent? What were the max G's on them during these phases?
Knights fighting a steam locomotive they believe is a dragon
Does the Intel 8086 CPU have user mode and kernel mode?
How important is a good quality camera for good photography?
What does Kasparov mean by "I was behind in three and even in one after six games"?
Spin vs orbital angular momenta in QFT
Is it normal practice to screen share with a client?
What is the meaning of "you has the wind of me"?
Why are so many countries still in the Commonwealth?
(1 of 11: Numberlink) What is Pyramid Cult's Favorite Activity?
Invert Some Switches on a Switchboard
Why no ";" after "do" in sh loops?
What to do when you reach a conclusion and find out later on that someone else already did?
USA: Can a witness take the 5th to avoid perjury?
What is the difference between 1/3, 1/2, and full casters?
Strange Cron Job takes up 100% of CPU Ubuntu 18 LTS Server
How to get the two pictures aligned
Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Computing the rectangle encompassing a node and a pointNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionAdjusting edge alignment and positioning of fitted nodeDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themUsing fit with nodepartsUsing tikz Calc package to add cordinates
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
tikz-pgf vertical-alignment
add a comment |
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
tikz-pgf vertical-alignment
1
You could usebegintikzpicture[baseline=(0,0)]
for bothtikzpicture
s, that will place the origin on the baseline. Another option is to place both diagrams in the sametikzpicture
environment, and enclose the second one inbeginscope[xshift=5cm] .. endscope
– Torbjørn T.
8 hours ago
add a comment |
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
tikz-pgf vertical-alignment
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
tikz-pgf vertical-alignment
tikz-pgf vertical-alignment
edited 9 hours ago
Torbjørn T.
163k13 gold badges267 silver badges453 bronze badges
163k13 gold badges267 silver badges453 bronze badges
asked 9 hours ago
Poline SandraPoline Sandra
1047 bronze badges
1047 bronze badges
1
You could usebegintikzpicture[baseline=(0,0)]
for bothtikzpicture
s, that will place the origin on the baseline. Another option is to place both diagrams in the sametikzpicture
environment, and enclose the second one inbeginscope[xshift=5cm] .. endscope
– Torbjørn T.
8 hours ago
add a comment |
1
You could usebegintikzpicture[baseline=(0,0)]
for bothtikzpicture
s, that will place the origin on the baseline. Another option is to place both diagrams in the sametikzpicture
environment, and enclose the second one inbeginscope[xshift=5cm] .. endscope
– Torbjørn T.
8 hours ago
1
1
You could use
begintikzpicture[baseline=(0,0)]
for both tikzpicture
s, that will place the origin on the baseline. Another option is to place both diagrams in the same tikzpicture
environment, and enclose the second one in beginscope[xshift=5cm] .. endscope
– Torbjørn T.
8 hours ago
You could use
begintikzpicture[baseline=(0,0)]
for both tikzpicture
s, that will place the origin on the baseline. Another option is to place both diagrams in the same tikzpicture
environment, and enclose the second one in beginscope[xshift=5cm] .. endscope
– Torbjørn T.
8 hours ago
add a comment |
3 Answers
3
active
oldest
votes
Well, to visualize the difference between both images I added fbox
to your pictures to get them printed in a frame:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
As you can see (red arrows in screenshot) the height of both images is different. Now let us have a look into your code:
First image:
node at (0,-2.25)$D$;
Second image:
node at (0,-2.5)$C$;
If you choose the same value, for example -2.5
for both images the picture are aligned ...
See the changed MWE to value -2.5
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
and without the added fbox
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
what change in without fbox
– Poline Sandra
8 hours ago
1
@PolineSandra See the x axis of both images: they are on the same height, so aligned images as wished ... The commandfbox
was only to visualize the difference of both images, with -2.5 there is no difference ...
– Mensch
8 hours ago
add a comment |
In the following MWE I have changed the y value of the node
in the marked line from 2.5
to 2.25
. With this change, the x axes of the two plots are aligned, as well as the labels of the y axes.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.25)$C$; %<-----
endtikzpicture
enddocument
add a comment |
As Torbjørn T pointed out in his commentary, it is sufficient to place the baseline of each figure at the origin [baseline=(0,0)]
.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
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%2f501598%2fhow-to-get-the-two-pictures-aligned%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
Well, to visualize the difference between both images I added fbox
to your pictures to get them printed in a frame:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
As you can see (red arrows in screenshot) the height of both images is different. Now let us have a look into your code:
First image:
node at (0,-2.25)$D$;
Second image:
node at (0,-2.5)$C$;
If you choose the same value, for example -2.5
for both images the picture are aligned ...
See the changed MWE to value -2.5
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
and without the added fbox
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
what change in without fbox
– Poline Sandra
8 hours ago
1
@PolineSandra See the x axis of both images: they are on the same height, so aligned images as wished ... The commandfbox
was only to visualize the difference of both images, with -2.5 there is no difference ...
– Mensch
8 hours ago
add a comment |
Well, to visualize the difference between both images I added fbox
to your pictures to get them printed in a frame:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
As you can see (red arrows in screenshot) the height of both images is different. Now let us have a look into your code:
First image:
node at (0,-2.25)$D$;
Second image:
node at (0,-2.5)$C$;
If you choose the same value, for example -2.5
for both images the picture are aligned ...
See the changed MWE to value -2.5
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
and without the added fbox
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
what change in without fbox
– Poline Sandra
8 hours ago
1
@PolineSandra See the x axis of both images: they are on the same height, so aligned images as wished ... The commandfbox
was only to visualize the difference of both images, with -2.5 there is no difference ...
– Mensch
8 hours ago
add a comment |
Well, to visualize the difference between both images I added fbox
to your pictures to get them printed in a frame:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
As you can see (red arrows in screenshot) the height of both images is different. Now let us have a look into your code:
First image:
node at (0,-2.25)$D$;
Second image:
node at (0,-2.5)$C$;
If you choose the same value, for example -2.5
for both images the picture are aligned ...
See the changed MWE to value -2.5
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
and without the added fbox
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
Well, to visualize the difference between both images I added fbox
to your pictures to get them printed in a frame:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
As you can see (red arrows in screenshot) the height of both images is different. Now let us have a look into your code:
First image:
node at (0,-2.25)$D$;
Second image:
node at (0,-2.5)$C$;
If you choose the same value, for example -2.5
for both images the picture are aligned ...
See the changed MWE to value -2.5
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
fbox
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
fbox
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
and without the added fbox
:
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.5)$D$;
endtikzpicture
begintikzpicture % <=================================================
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
with the result:
edited 8 hours ago
answered 9 hours ago
MenschMensch
46.6k10 gold badges52 silver badges178 bronze badges
46.6k10 gold badges52 silver badges178 bronze badges
what change in without fbox
– Poline Sandra
8 hours ago
1
@PolineSandra See the x axis of both images: they are on the same height, so aligned images as wished ... The commandfbox
was only to visualize the difference of both images, with -2.5 there is no difference ...
– Mensch
8 hours ago
add a comment |
what change in without fbox
– Poline Sandra
8 hours ago
1
@PolineSandra See the x axis of both images: they are on the same height, so aligned images as wished ... The commandfbox
was only to visualize the difference of both images, with -2.5 there is no difference ...
– Mensch
8 hours ago
what change in without fbox
– Poline Sandra
8 hours ago
what change in without fbox
– Poline Sandra
8 hours ago
1
1
@PolineSandra See the x axis of both images: they are on the same height, so aligned images as wished ... The command
fbox
was only to visualize the difference of both images, with -2.5 there is no difference ...– Mensch
8 hours ago
@PolineSandra See the x axis of both images: they are on the same height, so aligned images as wished ... The command
fbox
was only to visualize the difference of both images, with -2.5 there is no difference ...– Mensch
8 hours ago
add a comment |
In the following MWE I have changed the y value of the node
in the marked line from 2.5
to 2.25
. With this change, the x axes of the two plots are aligned, as well as the labels of the y axes.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.25)$C$; %<-----
endtikzpicture
enddocument
add a comment |
In the following MWE I have changed the y value of the node
in the marked line from 2.5
to 2.25
. With this change, the x axes of the two plots are aligned, as well as the labels of the y axes.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.25)$C$; %<-----
endtikzpicture
enddocument
add a comment |
In the following MWE I have changed the y value of the node
in the marked line from 2.5
to 2.25
. With this change, the x axes of the two plots are aligned, as well as the labels of the y axes.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.25)$C$; %<-----
endtikzpicture
enddocument
In the following MWE I have changed the y value of the node
in the marked line from 2.5
to 2.25
. With this change, the x axes of the two plots are aligned, as well as the labels of the y axes.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.25)$C$; %<-----
endtikzpicture
enddocument
answered 9 hours ago
leandriisleandriis
17k1 gold badge11 silver badges36 bronze badges
17k1 gold badge11 silver badges36 bronze badges
add a comment |
add a comment |
As Torbjørn T pointed out in his commentary, it is sufficient to place the baseline of each figure at the origin [baseline=(0,0)]
.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
add a comment |
As Torbjørn T pointed out in his commentary, it is sufficient to place the baseline of each figure at the origin [baseline=(0,0)]
.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
add a comment |
As Torbjørn T pointed out in his commentary, it is sufficient to place the baseline of each figure at the origin [baseline=(0,0)]
.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
As Torbjørn T pointed out in his commentary, it is sufficient to place the baseline of each figure at the origin [baseline=(0,0)]
.
documentclassarticle
usepackageamsmath,amssymb,amsthm
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usepackagemathrsfs
usepackageamsmath,amssymb,amsthm
usepackagegeometry
%%%%%%%%%%%%%%%%%%%
usetikzlibraryarrows
usepgfplotslibraryfillbetween
usetikzlibrarypatterns,shapes.geometric
begindocument
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=1,right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (-1,1)--(1,1)--(1,-1)--(-1,-1)--(-1,1);
node at (0,-2.25)$D$;
endtikzpicture
begintikzpicture[baseline=(0,0)]
draw[line width=.8pt,->] (-2,0.) -- node[pos=0.75,above right](2,0);
draw[line width=.8pt,->] (0.,-2) -- node[pos=0.75,above right]1(0,2);
draw[pattern=north west lines] (0,0) circle (1 cm);
node at (0,-2.5)$C$;
endtikzpicture
enddocument
answered 6 hours ago
AndréCAndréC
11.3k2 gold badges17 silver badges53 bronze badges
11.3k2 gold badges17 silver badges53 bronze badges
add a comment |
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%2f501598%2fhow-to-get-the-two-pictures-aligned%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
1
You could use
begintikzpicture[baseline=(0,0)]
for bothtikzpicture
s, that will place the origin on the baseline. Another option is to place both diagrams in the sametikzpicture
environment, and enclose the second one inbeginscope[xshift=5cm] .. endscope
– Torbjørn T.
8 hours ago