How to get a ellipse shaped node in Tikz Network?Rotate a node but not its content: the case of the ellipse decorationPut node on ellipse in tikzSize of TikZ ellipse nodeHow to define the default vertical distance between nodes?Tikz rectangle shaped arrowsNumerical conditional within tikz keys?Create shaped node with tikzRectanglar cloud shaped node in TikZDrawing U shaped node around another node in tikzGrid network in TikZ
My perfect evil overlord plan... or is it?
Was the Highlands Ranch shooting the 115th mass shooting in the US in 2019
Can a surprised creature fall prone voluntarily on their turn?
Why does it take longer to fly from London to Xi'an than to Beijing
Is it a good idea to copy a trader when investing?
How can I avoid subordinates and coworkers leaving work until the last minute, then having no time for revisions?
When do you stop "pushing" a book?
How to select certain lines (n, n+4, n+8, n+12...) from the file?
Is there any evidence to support the claim that the United States was "suckered into WW1" by Zionists, made by Benjamin Freedman in his 1961 speech
Does the 500 feet falling cap apply per fall, or per turn?
What was the notion of limit that Newton used?
Is ‘despite that’ right?
Is there some sort of formula to determine how many bricks I would need to build a completely new structure?
Two researchers want to work on the same extension to my paper. Who to help?
Any suggestions on how to make this table prettier and suggestions on whether it's better to make it fit in 1 or 2 columns
Examples where existence is harder than evaluation
Translation of the latin word 'sit' in Thomas Aquinas' works
Why is it wrong to *implement* myself a known, published, widely believed to be secure crypto algorithm?
spatiotemporal regression
How to rename pi as another value only for y axis without affecting pi used in x axis?
Is a vertical stabiliser needed for straight line flight in a glider?
Cryptography and elliptic curves
Was there a contingency plan in place if Little Boy failed to detonate?
When quoting someone, is it proper to change "gotta" to "got to" without modifying the rest of the quote?
How to get a ellipse shaped node in Tikz Network?
Rotate a node but not its content: the case of the ellipse decorationPut node on ellipse in tikzSize of TikZ ellipse nodeHow to define the default vertical distance between nodes?Tikz rectangle shaped arrowsNumerical conditional within tikz keys?Create shaped node with tikzRectanglar cloud shaped node in TikZDrawing U shaped node around another node in tikzGrid network in TikZ
I am using the excellent tikz-network package written by Jürgen Hackl.
I am trying to change shape of some nodes to be an ellipse, but I can't figure out how to. From the manual, tikz-network:
With the option shape the shape of the vertex can be modified. Thereby the shapes implemented in TikZ can be used, including: circle, rectangle, diamond, trapezium, semicircle, isosceles triangle, ...
But when I compile this code:
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2, shape=ellipse]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
all I get is this
while I would expect the shape of node 2 to be an ellipse, not a circle.
tikz-pgf
New contributor
add a comment |
I am using the excellent tikz-network package written by Jürgen Hackl.
I am trying to change shape of some nodes to be an ellipse, but I can't figure out how to. From the manual, tikz-network:
With the option shape the shape of the vertex can be modified. Thereby the shapes implemented in TikZ can be used, including: circle, rectangle, diamond, trapezium, semicircle, isosceles triangle, ...
But when I compile this code:
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2, shape=ellipse]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
all I get is this
while I would expect the shape of node 2 to be an ellipse, not a circle.
tikz-pgf
New contributor
Try use 2222222 instead of 2
– JouleV
5 hours ago
2
Thank you JouleV. I actually tried this already, down the the number of 2s! ;) but the label just spills over.
– Leo
5 hours ago
add a comment |
I am using the excellent tikz-network package written by Jürgen Hackl.
I am trying to change shape of some nodes to be an ellipse, but I can't figure out how to. From the manual, tikz-network:
With the option shape the shape of the vertex can be modified. Thereby the shapes implemented in TikZ can be used, including: circle, rectangle, diamond, trapezium, semicircle, isosceles triangle, ...
But when I compile this code:
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2, shape=ellipse]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
all I get is this
while I would expect the shape of node 2 to be an ellipse, not a circle.
tikz-pgf
New contributor
I am using the excellent tikz-network package written by Jürgen Hackl.
I am trying to change shape of some nodes to be an ellipse, but I can't figure out how to. From the manual, tikz-network:
With the option shape the shape of the vertex can be modified. Thereby the shapes implemented in TikZ can be used, including: circle, rectangle, diamond, trapezium, semicircle, isosceles triangle, ...
But when I compile this code:
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2, shape=ellipse]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
all I get is this
while I would expect the shape of node 2 to be an ellipse, not a circle.
tikz-pgf
tikz-pgf
New contributor
New contributor
edited 5 hours ago
Stefan Pinnow
20.5k83578
20.5k83578
New contributor
asked 5 hours ago
LeoLeo
1333
1333
New contributor
New contributor
Try use 2222222 instead of 2
– JouleV
5 hours ago
2
Thank you JouleV. I actually tried this already, down the the number of 2s! ;) but the label just spills over.
– Leo
5 hours ago
add a comment |
Try use 2222222 instead of 2
– JouleV
5 hours ago
2
Thank you JouleV. I actually tried this already, down the the number of 2s! ;) but the label just spills over.
– Leo
5 hours ago
Try use 2222222 instead of 2
– JouleV
5 hours ago
Try use 2222222 instead of 2
– JouleV
5 hours ago
2
2
Thank you JouleV. I actually tried this already, down the the number of 2s! ;) but the label just spills over.
– Leo
5 hours ago
Thank you JouleV. I actually tried this already, down the the number of 2s! ;) but the label just spills over.
– Leo
5 hours ago
add a comment |
2 Answers
2
active
oldest
votes
Actually, your shape is an ellipse. It just happens to be the same height and width, because those are the default settings. You can give extra TikZ options using the style
option of Vertex
.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2, shape=ellipse, style=minimum width=2cm]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
Thanks to your answer I also figured out how to use the regular polygon shape for a vertex: "Vertex[color=white, x=-1, y=1 shape=regular polygon, style=regular polygon sides=5, label=A]A"
– Leo
4 hours ago
add a comment |
Let me start by spelling out your and and Joule V's observation that the text will just overshoot if is longer than the package expects it to be.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
Needless to say that this looks a bit suboptimal. The internal reason why that happens is that the text is not the node contents
, as one may naively suspect/hope, but, as the label indicates, a label
. This problem can be solved as follows:
documentclassarticle
usepackagetikz-network
makeatletter
tikzsetnetwork x offset/.initial=1ex,network y offset/.initial=1ex,
adjust size/.style=minimum width=width("vertex@Label")+2*pgfkeysvalueof/tikz/network x offset,
minimum height=height("vertex@Label")+2*pgfkeysvalueof/tikz/network y offset
makeatother
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
tikzsetevery label/.append style=
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse,
style=adjust size]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
So all you need to do is to add style=adjust size
. As a side effect, this will then really become an ellipse if, as suggested by JouleV, once you insert a wider (or higher) text. The keys network x offset
and network y offset
can be thought of as the analogues of the ordinary pgf keys inner xsep
and inner ysep
.
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
);
);
Leo is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f490003%2fhow-to-get-a-ellipse-shaped-node-in-tikz-network%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
Actually, your shape is an ellipse. It just happens to be the same height and width, because those are the default settings. You can give extra TikZ options using the style
option of Vertex
.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2, shape=ellipse, style=minimum width=2cm]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
Thanks to your answer I also figured out how to use the regular polygon shape for a vertex: "Vertex[color=white, x=-1, y=1 shape=regular polygon, style=regular polygon sides=5, label=A]A"
– Leo
4 hours ago
add a comment |
Actually, your shape is an ellipse. It just happens to be the same height and width, because those are the default settings. You can give extra TikZ options using the style
option of Vertex
.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2, shape=ellipse, style=minimum width=2cm]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
Thanks to your answer I also figured out how to use the regular polygon shape for a vertex: "Vertex[color=white, x=-1, y=1 shape=regular polygon, style=regular polygon sides=5, label=A]A"
– Leo
4 hours ago
add a comment |
Actually, your shape is an ellipse. It just happens to be the same height and width, because those are the default settings. You can give extra TikZ options using the style
option of Vertex
.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2, shape=ellipse, style=minimum width=2cm]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
Actually, your shape is an ellipse. It just happens to be the same height and width, because those are the default settings. You can give extra TikZ options using the style
option of Vertex
.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2, shape=ellipse, style=minimum width=2cm]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
answered 5 hours ago
schtandardschtandard
2,6171121
2,6171121
Thanks to your answer I also figured out how to use the regular polygon shape for a vertex: "Vertex[color=white, x=-1, y=1 shape=regular polygon, style=regular polygon sides=5, label=A]A"
– Leo
4 hours ago
add a comment |
Thanks to your answer I also figured out how to use the regular polygon shape for a vertex: "Vertex[color=white, x=-1, y=1 shape=regular polygon, style=regular polygon sides=5, label=A]A"
– Leo
4 hours ago
Thanks to your answer I also figured out how to use the regular polygon shape for a vertex: "Vertex[color=white, x=-1, y=1 shape=regular polygon, style=regular polygon sides=5, label=A]A"
– Leo
4 hours ago
Thanks to your answer I also figured out how to use the regular polygon shape for a vertex: "Vertex[color=white, x=-1, y=1 shape=regular polygon, style=regular polygon sides=5, label=A]A"
– Leo
4 hours ago
add a comment |
Let me start by spelling out your and and Joule V's observation that the text will just overshoot if is longer than the package expects it to be.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
Needless to say that this looks a bit suboptimal. The internal reason why that happens is that the text is not the node contents
, as one may naively suspect/hope, but, as the label indicates, a label
. This problem can be solved as follows:
documentclassarticle
usepackagetikz-network
makeatletter
tikzsetnetwork x offset/.initial=1ex,network y offset/.initial=1ex,
adjust size/.style=minimum width=width("vertex@Label")+2*pgfkeysvalueof/tikz/network x offset,
minimum height=height("vertex@Label")+2*pgfkeysvalueof/tikz/network y offset
makeatother
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
tikzsetevery label/.append style=
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse,
style=adjust size]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
So all you need to do is to add style=adjust size
. As a side effect, this will then really become an ellipse if, as suggested by JouleV, once you insert a wider (or higher) text. The keys network x offset
and network y offset
can be thought of as the analogues of the ordinary pgf keys inner xsep
and inner ysep
.
add a comment |
Let me start by spelling out your and and Joule V's observation that the text will just overshoot if is longer than the package expects it to be.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
Needless to say that this looks a bit suboptimal. The internal reason why that happens is that the text is not the node contents
, as one may naively suspect/hope, but, as the label indicates, a label
. This problem can be solved as follows:
documentclassarticle
usepackagetikz-network
makeatletter
tikzsetnetwork x offset/.initial=1ex,network y offset/.initial=1ex,
adjust size/.style=minimum width=width("vertex@Label")+2*pgfkeysvalueof/tikz/network x offset,
minimum height=height("vertex@Label")+2*pgfkeysvalueof/tikz/network y offset
makeatother
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
tikzsetevery label/.append style=
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse,
style=adjust size]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
So all you need to do is to add style=adjust size
. As a side effect, this will then really become an ellipse if, as suggested by JouleV, once you insert a wider (or higher) text. The keys network x offset
and network y offset
can be thought of as the analogues of the ordinary pgf keys inner xsep
and inner ysep
.
add a comment |
Let me start by spelling out your and and Joule V's observation that the text will just overshoot if is longer than the package expects it to be.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
Needless to say that this looks a bit suboptimal. The internal reason why that happens is that the text is not the node contents
, as one may naively suspect/hope, but, as the label indicates, a label
. This problem can be solved as follows:
documentclassarticle
usepackagetikz-network
makeatletter
tikzsetnetwork x offset/.initial=1ex,network y offset/.initial=1ex,
adjust size/.style=minimum width=width("vertex@Label")+2*pgfkeysvalueof/tikz/network x offset,
minimum height=height("vertex@Label")+2*pgfkeysvalueof/tikz/network y offset
makeatother
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
tikzsetevery label/.append style=
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse,
style=adjust size]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
So all you need to do is to add style=adjust size
. As a side effect, this will then really become an ellipse if, as suggested by JouleV, once you insert a wider (or higher) text. The keys network x offset
and network y offset
can be thought of as the analogues of the ordinary pgf keys inner xsep
and inner ysep
.
Let me start by spelling out your and and Joule V's observation that the text will just overshoot if is longer than the package expects it to be.
documentclassarticle
usepackagetikz-network
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
Needless to say that this looks a bit suboptimal. The internal reason why that happens is that the text is not the node contents
, as one may naively suspect/hope, but, as the label indicates, a label
. This problem can be solved as follows:
documentclassarticle
usepackagetikz-network
makeatletter
tikzsetnetwork x offset/.initial=1ex,network y offset/.initial=1ex,
adjust size/.style=minimum width=width("vertex@Label")+2*pgfkeysvalueof/tikz/network x offset,
minimum height=height("vertex@Label")+2*pgfkeysvalueof/tikz/network y offset
makeatother
begindocument
begintikzpicture
Vertex[color=white, x=-1, y=1, label=A]A
Vertex[color=white, x=1, y=1, label=B, shape=rectangle]B
tikzsetevery label/.append style=
Vertex[color=white, x=0, y=0, label=2222222, shape=ellipse,
style=adjust size]2
Edge[lw=1, Direct](A)(2)
Edge[lw=1, Direct](B)(2)
endtikzpicture
enddocument
So all you need to do is to add style=adjust size
. As a side effect, this will then really become an ellipse if, as suggested by JouleV, once you insert a wider (or higher) text. The keys network x offset
and network y offset
can be thought of as the analogues of the ordinary pgf keys inner xsep
and inner ysep
.
edited 3 hours ago
answered 4 hours ago
marmotmarmot
125k6162308
125k6162308
add a comment |
add a comment |
Leo is a new contributor. Be nice, and check out our Code of Conduct.
Leo is a new contributor. Be nice, and check out our Code of Conduct.
Leo is a new contributor. Be nice, and check out our Code of Conduct.
Leo is a new contributor. Be nice, and check out our Code of Conduct.
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%2f490003%2fhow-to-get-a-ellipse-shaped-node-in-tikz-network%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
Try use 2222222 instead of 2
– JouleV
5 hours ago
2
Thank you JouleV. I actually tried this already, down the the number of 2s! ;) but the label just spills over.
– Leo
5 hours ago