You can set minimum height=<length>
, or minimum width=<length>
as shown in MWE:
Notes:
- As Qrrbrbirlbel commented, setting
minimum size
is setting both the values of minimum width
and minimum height
and hence you end up with a circle.
- If you want to specify both the
minimum height=
and minimum width=
parameters you need to set them to different values, otherwise you will again end up with a circle.
Code:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes}
\tikzstyle{every node}=[ultra thick, draw=blue, ellipse, minimum width=100pt,
align=center]
\node (a) {Alpha};
\node[left=150pt, below=30pt] (b) at (a) {Beta};
\end{tikzpicture}
\end{document}
The node’s border is a path, you can use the same options for a \path
, e.g. ultra thin
, thick
, very thick
, and so on:
\node[circle, draw=blue!80, thick, inner sep=0pt, minimum size=12pt] (1) at (0,0) {1};
The line width
key works as well:
\node[circle,draw=blue!80, line width=1mm, inner sep=0pt,minimum size=12pt] (1) at(0,0) {1};
All predefined line widths are
\tikzset{
ultra thin/.style= {line width=0.1pt},
very thin/.style= {line width=0.2pt},
thin/.style= {line width=0.4pt},% thin is the default
semithick/.style= {line width=0.6pt},
thick/.style= {line width=0.8pt},
very thick/.style= {line width=1.2pt},
ultra thick/.style={line width=1.6pt}
}
Code
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[
every node/.append style={circle, draw=blue!80, inner sep=0pt, minimum size=12pt}]
\node (1) at (0,0) {1};
\node[thick] (2) at (1,0) {2};
\node[line width=1mm] (3) at (2,0) {3};
\end{tikzpicture}
\end{document}
Output
Best Answer
You can define a
/.code
(or/.code 2 args
, or/.code n args
) key that executes your desired code. To define a new color within a style, you could define a keyYour example could look like this