Diagram in Tikz environment
I'm looking to create something like this in Tikz environment. Any tips? help?
tikz-pgf
add a comment |
I'm looking to create something like this in Tikz environment. Any tips? help?
tikz-pgf
4
Hi. What have you tried?
– JouleV
12 hours ago
6
There is the forest package, which is based on tikz. And tikz has a trees library.
– marmot
12 hours ago
add a comment |
I'm looking to create something like this in Tikz environment. Any tips? help?
tikz-pgf
I'm looking to create something like this in Tikz environment. Any tips? help?
tikz-pgf
tikz-pgf
asked 12 hours ago
RebeccaRebecca
684
684
4
Hi. What have you tried?
– JouleV
12 hours ago
6
There is the forest package, which is based on tikz. And tikz has a trees library.
– marmot
12 hours ago
add a comment |
4
Hi. What have you tried?
– JouleV
12 hours ago
6
There is the forest package, which is based on tikz. And tikz has a trees library.
– marmot
12 hours ago
4
4
Hi. What have you tried?
– JouleV
12 hours ago
Hi. What have you tried?
– JouleV
12 hours ago
6
6
There is the forest package, which is based on tikz. And tikz has a trees library.
– marmot
12 hours ago
There is the forest package, which is based on tikz. And tikz has a trees library.
– marmot
12 hours ago
add a comment |
3 Answers
3
active
oldest
votes
The forest
package allows you to recreate these figures.
documentclass{article}
usepackage[edges]{forest}
begin{document}
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=2.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
if level=2{fill=blue,minimum width={1.1*width("Varianz unbekannt")}}{},
}
[Erwartungswert $mu$
[Merkmal\ normalverteilt
[Varianz bekannt]
[Varianz unbekannt]
]
[Merkmal beliebig\ verteilt]
]
end{forest}
bigskip
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=3.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
}
[Varianz $sigma^2$
[Merkmal\ normalverteilt
]
]
end{forest}
end{document}
thank you so much!
– Rebecca
12 hours ago
1
afterl sep = 2.5em,
i would addfork sep = 1.2em,
:-). nice answer!
– Zarko
10 hours ago
@Zarko Thanks! I agree! (The OP now knows what to do. ;-)
– marmot
10 hours ago
@marmot, i wonder why is needed to multiplywidth("...")
with1.1
that both nodes in level have equal width (or write for example asminimum width={width(" Merkmal beliebig ")}
?
– Zarko
10 hours ago
@Zarko This is not necessary, I only used one possible way of making the nodes equally wide at each level and having some grace distance on both sides. There are more sophisticated methods which I was too lazy too look up. I believe when getting exposed to forest for the first time one should not get overwhelmed with something likemax(width(content))
(I just made this up but there are such options).
– marmot
10 hours ago
add a comment |
An alternative to @marmot's nice answer:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
filv/.style={
fill=green!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
},
selv/.style={
fill=cyan!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm,
align=center
},
thlv/.style={
fill=blue!30!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
}
]
node[filv] (lv1-1) {Erwartungswert $mu$};
node[filv,below=2cm of lv1-1.south] (lv1-2) {Varianz $sigma^2$};
node[selv,above right=0.25cm and 1.5cm of lv1-1.east] (lv2-1) {Merkmal\ normalverteilt};
node[selv,below right=0.25cm and 1.5cm of lv1-1.east] (lv2-2) {Merkmal beliebig\ verteilt};
node[selv,right=1.5cm of lv1-2.east] (lv2-3) {Merkmal\ normalverteilt};
node[thlv,right=1.5cm of lv2-1.north east] (lv3-1) {Varianz bekannt};
node[thlv,right=1.5cm of lv2-1.south east] (lv3-2) {Varianz unbekannt};
draw[-latex] (lv1-2)--(lv2-3);
coordinate[right=0.75cm of lv1-1.east] (mid1);
coordinate[left=0.75cm of lv2-1.west] (mid1-a);
coordinate[left=0.75cm of lv2-2.west] (mid1-b);
draw (lv1-1)--(mid1);
draw[latex-latex] (lv2-2)--(mid1-b)--(mid1-a)--(lv2-1);
coordinate[right=0.75cm of lv2-1.east] (mid2);
coordinate[left=0.75cm of lv3-1.west] (mid2-a);
coordinate[left=0.75cm of lv3-2.west] (mid2-b);
draw (lv2-1)--(mid2);
draw[latex-latex] (lv3-2)--(mid2-b)--(mid2-a)--(lv3-1);
end{tikzpicture}
end{document}
add a comment |
for completness ... pure tikz
version with using trees
library:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows, positioning, trees}
begin{document}
begin{figure}
tikzset{
base/.style = {rounded corners,
text=white, font=sffamily,
minimum width=20ex,
align=center},
L1/.style = {base, fill=teal},
L2/.style = {base, fill=cyan!80!black},
L3/.style = {base, fill=cyan!60!black},
grow=east,
edge from parent fork right,
level distance = 37mm,
level 1/.style = {sibling distance=16mm},
level 2/.style = {sibling distance = 8mm},
edge from parent/.style = {draw, semithick, -latex}
}
begin{tikzpicture}
node[L1] {Erwartungswert $mu$}
child {node[L2] {Merkmal\ normalverteilt}
child {node[L3] {Varianz bekannt}}
child {node[L3] {Varianz unbekannt}}
}
child {node[L2] {Merkmal beliebig\ verteilt}}
;
end{tikzpicture}
bigskip
begin{tikzpicture}
node[L1] {Varianz $sigma^2$}
child {node[L2] {Merkmal\ normalverteilt}}
;
end{tikzpicture}
end{figure}
end{document}
of course, with forest
is more simply and elegant solution
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%2f475683%2fdiagram-in-tikz-environment%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
The forest
package allows you to recreate these figures.
documentclass{article}
usepackage[edges]{forest}
begin{document}
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=2.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
if level=2{fill=blue,minimum width={1.1*width("Varianz unbekannt")}}{},
}
[Erwartungswert $mu$
[Merkmal\ normalverteilt
[Varianz bekannt]
[Varianz unbekannt]
]
[Merkmal beliebig\ verteilt]
]
end{forest}
bigskip
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=3.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
}
[Varianz $sigma^2$
[Merkmal\ normalverteilt
]
]
end{forest}
end{document}
thank you so much!
– Rebecca
12 hours ago
1
afterl sep = 2.5em,
i would addfork sep = 1.2em,
:-). nice answer!
– Zarko
10 hours ago
@Zarko Thanks! I agree! (The OP now knows what to do. ;-)
– marmot
10 hours ago
@marmot, i wonder why is needed to multiplywidth("...")
with1.1
that both nodes in level have equal width (or write for example asminimum width={width(" Merkmal beliebig ")}
?
– Zarko
10 hours ago
@Zarko This is not necessary, I only used one possible way of making the nodes equally wide at each level and having some grace distance on both sides. There are more sophisticated methods which I was too lazy too look up. I believe when getting exposed to forest for the first time one should not get overwhelmed with something likemax(width(content))
(I just made this up but there are such options).
– marmot
10 hours ago
add a comment |
The forest
package allows you to recreate these figures.
documentclass{article}
usepackage[edges]{forest}
begin{document}
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=2.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
if level=2{fill=blue,minimum width={1.1*width("Varianz unbekannt")}}{},
}
[Erwartungswert $mu$
[Merkmal\ normalverteilt
[Varianz bekannt]
[Varianz unbekannt]
]
[Merkmal beliebig\ verteilt]
]
end{forest}
bigskip
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=3.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
}
[Varianz $sigma^2$
[Merkmal\ normalverteilt
]
]
end{forest}
end{document}
thank you so much!
– Rebecca
12 hours ago
1
afterl sep = 2.5em,
i would addfork sep = 1.2em,
:-). nice answer!
– Zarko
10 hours ago
@Zarko Thanks! I agree! (The OP now knows what to do. ;-)
– marmot
10 hours ago
@marmot, i wonder why is needed to multiplywidth("...")
with1.1
that both nodes in level have equal width (or write for example asminimum width={width(" Merkmal beliebig ")}
?
– Zarko
10 hours ago
@Zarko This is not necessary, I only used one possible way of making the nodes equally wide at each level and having some grace distance on both sides. There are more sophisticated methods which I was too lazy too look up. I believe when getting exposed to forest for the first time one should not get overwhelmed with something likemax(width(content))
(I just made this up but there are such options).
– marmot
10 hours ago
add a comment |
The forest
package allows you to recreate these figures.
documentclass{article}
usepackage[edges]{forest}
begin{document}
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=2.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
if level=2{fill=blue,minimum width={1.1*width("Varianz unbekannt")}}{},
}
[Erwartungswert $mu$
[Merkmal\ normalverteilt
[Varianz bekannt]
[Varianz unbekannt]
]
[Merkmal beliebig\ verteilt]
]
end{forest}
bigskip
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=3.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
}
[Varianz $sigma^2$
[Merkmal\ normalverteilt
]
]
end{forest}
end{document}
The forest
package allows you to recreate these figures.
documentclass{article}
usepackage[edges]{forest}
begin{document}
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=2.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
if level=2{fill=blue,minimum width={1.1*width("Varianz unbekannt")}}{},
}
[Erwartungswert $mu$
[Merkmal\ normalverteilt
[Varianz bekannt]
[Varianz unbekannt]
]
[Merkmal beliebig\ verteilt]
]
end{forest}
bigskip
begin{forest}
for tree={rounded corners,text=white,font=sffamily,align=center,
grow'=east,forked edges,edge = {semithick, -stealth}, % see https://tex.stackexchange.com/a/333597/121799
anchor=west,l sep=3.5em,
if level=0{fill=green!60!black}{},
if level=1{fill=blue!70,minimum width={1.1*width("Merkmal beliebig")}}{},
}
[Varianz $sigma^2$
[Merkmal\ normalverteilt
]
]
end{forest}
end{document}
answered 12 hours ago
marmotmarmot
102k4119228
102k4119228
thank you so much!
– Rebecca
12 hours ago
1
afterl sep = 2.5em,
i would addfork sep = 1.2em,
:-). nice answer!
– Zarko
10 hours ago
@Zarko Thanks! I agree! (The OP now knows what to do. ;-)
– marmot
10 hours ago
@marmot, i wonder why is needed to multiplywidth("...")
with1.1
that both nodes in level have equal width (or write for example asminimum width={width(" Merkmal beliebig ")}
?
– Zarko
10 hours ago
@Zarko This is not necessary, I only used one possible way of making the nodes equally wide at each level and having some grace distance on both sides. There are more sophisticated methods which I was too lazy too look up. I believe when getting exposed to forest for the first time one should not get overwhelmed with something likemax(width(content))
(I just made this up but there are such options).
– marmot
10 hours ago
add a comment |
thank you so much!
– Rebecca
12 hours ago
1
afterl sep = 2.5em,
i would addfork sep = 1.2em,
:-). nice answer!
– Zarko
10 hours ago
@Zarko Thanks! I agree! (The OP now knows what to do. ;-)
– marmot
10 hours ago
@marmot, i wonder why is needed to multiplywidth("...")
with1.1
that both nodes in level have equal width (or write for example asminimum width={width(" Merkmal beliebig ")}
?
– Zarko
10 hours ago
@Zarko This is not necessary, I only used one possible way of making the nodes equally wide at each level and having some grace distance on both sides. There are more sophisticated methods which I was too lazy too look up. I believe when getting exposed to forest for the first time one should not get overwhelmed with something likemax(width(content))
(I just made this up but there are such options).
– marmot
10 hours ago
thank you so much!
– Rebecca
12 hours ago
thank you so much!
– Rebecca
12 hours ago
1
1
after
l sep = 2.5em,
i would add fork sep = 1.2em,
:-). nice answer!– Zarko
10 hours ago
after
l sep = 2.5em,
i would add fork sep = 1.2em,
:-). nice answer!– Zarko
10 hours ago
@Zarko Thanks! I agree! (The OP now knows what to do. ;-)
– marmot
10 hours ago
@Zarko Thanks! I agree! (The OP now knows what to do. ;-)
– marmot
10 hours ago
@marmot, i wonder why is needed to multiply
width("...")
with 1.1
that both nodes in level have equal width (or write for example as minimum width={width(" Merkmal beliebig ")}
?– Zarko
10 hours ago
@marmot, i wonder why is needed to multiply
width("...")
with 1.1
that both nodes in level have equal width (or write for example as minimum width={width(" Merkmal beliebig ")}
?– Zarko
10 hours ago
@Zarko This is not necessary, I only used one possible way of making the nodes equally wide at each level and having some grace distance on both sides. There are more sophisticated methods which I was too lazy too look up. I believe when getting exposed to forest for the first time one should not get overwhelmed with something like
max(width(content))
(I just made this up but there are such options).– marmot
10 hours ago
@Zarko This is not necessary, I only used one possible way of making the nodes equally wide at each level and having some grace distance on both sides. There are more sophisticated methods which I was too lazy too look up. I believe when getting exposed to forest for the first time one should not get overwhelmed with something like
max(width(content))
(I just made this up but there are such options).– marmot
10 hours ago
add a comment |
An alternative to @marmot's nice answer:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
filv/.style={
fill=green!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
},
selv/.style={
fill=cyan!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm,
align=center
},
thlv/.style={
fill=blue!30!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
}
]
node[filv] (lv1-1) {Erwartungswert $mu$};
node[filv,below=2cm of lv1-1.south] (lv1-2) {Varianz $sigma^2$};
node[selv,above right=0.25cm and 1.5cm of lv1-1.east] (lv2-1) {Merkmal\ normalverteilt};
node[selv,below right=0.25cm and 1.5cm of lv1-1.east] (lv2-2) {Merkmal beliebig\ verteilt};
node[selv,right=1.5cm of lv1-2.east] (lv2-3) {Merkmal\ normalverteilt};
node[thlv,right=1.5cm of lv2-1.north east] (lv3-1) {Varianz bekannt};
node[thlv,right=1.5cm of lv2-1.south east] (lv3-2) {Varianz unbekannt};
draw[-latex] (lv1-2)--(lv2-3);
coordinate[right=0.75cm of lv1-1.east] (mid1);
coordinate[left=0.75cm of lv2-1.west] (mid1-a);
coordinate[left=0.75cm of lv2-2.west] (mid1-b);
draw (lv1-1)--(mid1);
draw[latex-latex] (lv2-2)--(mid1-b)--(mid1-a)--(lv2-1);
coordinate[right=0.75cm of lv2-1.east] (mid2);
coordinate[left=0.75cm of lv3-1.west] (mid2-a);
coordinate[left=0.75cm of lv3-2.west] (mid2-b);
draw (lv2-1)--(mid2);
draw[latex-latex] (lv3-2)--(mid2-b)--(mid2-a)--(lv3-1);
end{tikzpicture}
end{document}
add a comment |
An alternative to @marmot's nice answer:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
filv/.style={
fill=green!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
},
selv/.style={
fill=cyan!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm,
align=center
},
thlv/.style={
fill=blue!30!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
}
]
node[filv] (lv1-1) {Erwartungswert $mu$};
node[filv,below=2cm of lv1-1.south] (lv1-2) {Varianz $sigma^2$};
node[selv,above right=0.25cm and 1.5cm of lv1-1.east] (lv2-1) {Merkmal\ normalverteilt};
node[selv,below right=0.25cm and 1.5cm of lv1-1.east] (lv2-2) {Merkmal beliebig\ verteilt};
node[selv,right=1.5cm of lv1-2.east] (lv2-3) {Merkmal\ normalverteilt};
node[thlv,right=1.5cm of lv2-1.north east] (lv3-1) {Varianz bekannt};
node[thlv,right=1.5cm of lv2-1.south east] (lv3-2) {Varianz unbekannt};
draw[-latex] (lv1-2)--(lv2-3);
coordinate[right=0.75cm of lv1-1.east] (mid1);
coordinate[left=0.75cm of lv2-1.west] (mid1-a);
coordinate[left=0.75cm of lv2-2.west] (mid1-b);
draw (lv1-1)--(mid1);
draw[latex-latex] (lv2-2)--(mid1-b)--(mid1-a)--(lv2-1);
coordinate[right=0.75cm of lv2-1.east] (mid2);
coordinate[left=0.75cm of lv3-1.west] (mid2-a);
coordinate[left=0.75cm of lv3-2.west] (mid2-b);
draw (lv2-1)--(mid2);
draw[latex-latex] (lv3-2)--(mid2-b)--(mid2-a)--(lv3-1);
end{tikzpicture}
end{document}
add a comment |
An alternative to @marmot's nice answer:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
filv/.style={
fill=green!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
},
selv/.style={
fill=cyan!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm,
align=center
},
thlv/.style={
fill=blue!30!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
}
]
node[filv] (lv1-1) {Erwartungswert $mu$};
node[filv,below=2cm of lv1-1.south] (lv1-2) {Varianz $sigma^2$};
node[selv,above right=0.25cm and 1.5cm of lv1-1.east] (lv2-1) {Merkmal\ normalverteilt};
node[selv,below right=0.25cm and 1.5cm of lv1-1.east] (lv2-2) {Merkmal beliebig\ verteilt};
node[selv,right=1.5cm of lv1-2.east] (lv2-3) {Merkmal\ normalverteilt};
node[thlv,right=1.5cm of lv2-1.north east] (lv3-1) {Varianz bekannt};
node[thlv,right=1.5cm of lv2-1.south east] (lv3-2) {Varianz unbekannt};
draw[-latex] (lv1-2)--(lv2-3);
coordinate[right=0.75cm of lv1-1.east] (mid1);
coordinate[left=0.75cm of lv2-1.west] (mid1-a);
coordinate[left=0.75cm of lv2-2.west] (mid1-b);
draw (lv1-1)--(mid1);
draw[latex-latex] (lv2-2)--(mid1-b)--(mid1-a)--(lv2-1);
coordinate[right=0.75cm of lv2-1.east] (mid2);
coordinate[left=0.75cm of lv3-1.west] (mid2-a);
coordinate[left=0.75cm of lv3-2.west] (mid2-b);
draw (lv2-1)--(mid2);
draw[latex-latex] (lv3-2)--(mid2-b)--(mid2-a)--(lv3-1);
end{tikzpicture}
end{document}
An alternative to @marmot's nice answer:
documentclass[tikz,margin=3mm]{standalone}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
filv/.style={
fill=green!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
},
selv/.style={
fill=cyan!50!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm,
align=center
},
thlv/.style={
fill=blue!30!black,
font=color{white},
rectangle,
rounded corners=3pt,
minimum width=3.5cm
}
]
node[filv] (lv1-1) {Erwartungswert $mu$};
node[filv,below=2cm of lv1-1.south] (lv1-2) {Varianz $sigma^2$};
node[selv,above right=0.25cm and 1.5cm of lv1-1.east] (lv2-1) {Merkmal\ normalverteilt};
node[selv,below right=0.25cm and 1.5cm of lv1-1.east] (lv2-2) {Merkmal beliebig\ verteilt};
node[selv,right=1.5cm of lv1-2.east] (lv2-3) {Merkmal\ normalverteilt};
node[thlv,right=1.5cm of lv2-1.north east] (lv3-1) {Varianz bekannt};
node[thlv,right=1.5cm of lv2-1.south east] (lv3-2) {Varianz unbekannt};
draw[-latex] (lv1-2)--(lv2-3);
coordinate[right=0.75cm of lv1-1.east] (mid1);
coordinate[left=0.75cm of lv2-1.west] (mid1-a);
coordinate[left=0.75cm of lv2-2.west] (mid1-b);
draw (lv1-1)--(mid1);
draw[latex-latex] (lv2-2)--(mid1-b)--(mid1-a)--(lv2-1);
coordinate[right=0.75cm of lv2-1.east] (mid2);
coordinate[left=0.75cm of lv3-1.west] (mid2-a);
coordinate[left=0.75cm of lv3-2.west] (mid2-b);
draw (lv2-1)--(mid2);
draw[latex-latex] (lv3-2)--(mid2-b)--(mid2-a)--(lv3-1);
end{tikzpicture}
end{document}
answered 12 hours ago
JouleVJouleV
3,8441937
3,8441937
add a comment |
add a comment |
for completness ... pure tikz
version with using trees
library:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows, positioning, trees}
begin{document}
begin{figure}
tikzset{
base/.style = {rounded corners,
text=white, font=sffamily,
minimum width=20ex,
align=center},
L1/.style = {base, fill=teal},
L2/.style = {base, fill=cyan!80!black},
L3/.style = {base, fill=cyan!60!black},
grow=east,
edge from parent fork right,
level distance = 37mm,
level 1/.style = {sibling distance=16mm},
level 2/.style = {sibling distance = 8mm},
edge from parent/.style = {draw, semithick, -latex}
}
begin{tikzpicture}
node[L1] {Erwartungswert $mu$}
child {node[L2] {Merkmal\ normalverteilt}
child {node[L3] {Varianz bekannt}}
child {node[L3] {Varianz unbekannt}}
}
child {node[L2] {Merkmal beliebig\ verteilt}}
;
end{tikzpicture}
bigskip
begin{tikzpicture}
node[L1] {Varianz $sigma^2$}
child {node[L2] {Merkmal\ normalverteilt}}
;
end{tikzpicture}
end{figure}
end{document}
of course, with forest
is more simply and elegant solution
add a comment |
for completness ... pure tikz
version with using trees
library:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows, positioning, trees}
begin{document}
begin{figure}
tikzset{
base/.style = {rounded corners,
text=white, font=sffamily,
minimum width=20ex,
align=center},
L1/.style = {base, fill=teal},
L2/.style = {base, fill=cyan!80!black},
L3/.style = {base, fill=cyan!60!black},
grow=east,
edge from parent fork right,
level distance = 37mm,
level 1/.style = {sibling distance=16mm},
level 2/.style = {sibling distance = 8mm},
edge from parent/.style = {draw, semithick, -latex}
}
begin{tikzpicture}
node[L1] {Erwartungswert $mu$}
child {node[L2] {Merkmal\ normalverteilt}
child {node[L3] {Varianz bekannt}}
child {node[L3] {Varianz unbekannt}}
}
child {node[L2] {Merkmal beliebig\ verteilt}}
;
end{tikzpicture}
bigskip
begin{tikzpicture}
node[L1] {Varianz $sigma^2$}
child {node[L2] {Merkmal\ normalverteilt}}
;
end{tikzpicture}
end{figure}
end{document}
of course, with forest
is more simply and elegant solution
add a comment |
for completness ... pure tikz
version with using trees
library:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows, positioning, trees}
begin{document}
begin{figure}
tikzset{
base/.style = {rounded corners,
text=white, font=sffamily,
minimum width=20ex,
align=center},
L1/.style = {base, fill=teal},
L2/.style = {base, fill=cyan!80!black},
L3/.style = {base, fill=cyan!60!black},
grow=east,
edge from parent fork right,
level distance = 37mm,
level 1/.style = {sibling distance=16mm},
level 2/.style = {sibling distance = 8mm},
edge from parent/.style = {draw, semithick, -latex}
}
begin{tikzpicture}
node[L1] {Erwartungswert $mu$}
child {node[L2] {Merkmal\ normalverteilt}
child {node[L3] {Varianz bekannt}}
child {node[L3] {Varianz unbekannt}}
}
child {node[L2] {Merkmal beliebig\ verteilt}}
;
end{tikzpicture}
bigskip
begin{tikzpicture}
node[L1] {Varianz $sigma^2$}
child {node[L2] {Merkmal\ normalverteilt}}
;
end{tikzpicture}
end{figure}
end{document}
of course, with forest
is more simply and elegant solution
for completness ... pure tikz
version with using trees
library:
documentclass{article}
usepackage{tikz}
usetikzlibrary{arrows, positioning, trees}
begin{document}
begin{figure}
tikzset{
base/.style = {rounded corners,
text=white, font=sffamily,
minimum width=20ex,
align=center},
L1/.style = {base, fill=teal},
L2/.style = {base, fill=cyan!80!black},
L3/.style = {base, fill=cyan!60!black},
grow=east,
edge from parent fork right,
level distance = 37mm,
level 1/.style = {sibling distance=16mm},
level 2/.style = {sibling distance = 8mm},
edge from parent/.style = {draw, semithick, -latex}
}
begin{tikzpicture}
node[L1] {Erwartungswert $mu$}
child {node[L2] {Merkmal\ normalverteilt}
child {node[L3] {Varianz bekannt}}
child {node[L3] {Varianz unbekannt}}
}
child {node[L2] {Merkmal beliebig\ verteilt}}
;
end{tikzpicture}
bigskip
begin{tikzpicture}
node[L1] {Varianz $sigma^2$}
child {node[L2] {Merkmal\ normalverteilt}}
;
end{tikzpicture}
end{figure}
end{document}
of course, with forest
is more simply and elegant solution
edited 9 hours ago
answered 9 hours ago
ZarkoZarko
125k866164
125k866164
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%2f475683%2fdiagram-in-tikz-environment%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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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
4
Hi. What have you tried?
– JouleV
12 hours ago
6
There is the forest package, which is based on tikz. And tikz has a trees library.
– marmot
12 hours ago