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
![enter image description here](https://i.stack.imgur.com/BR8gc.png)
This is very easy and may be a duplicate too. Any way, I am posting this and if this is closed a duplicate, I will delete this answer.
\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0,0) {\includegraphics[width=4in]{example-image-a}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
%% next four lines will help you to locate the point needed by forming a grid. comment these four lines in the final picture.↓
% \draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
% \draw[help lines,xstep=.05,ystep=.05] (0,0) grid (1,1);
% \foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }
% \foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y};}
%% upto here↑
\draw[dashed,-latex] (0.8,0.8) -- +(1.1in,0.2in)node[anchor=west] {1};
\draw[dashed,-latex] (0.6,0.6) -- +(1.9in,0)node[anchor=west] {2};
\draw[dashed,-latex] (0.4,0.5) -- +(-2in,0)node[anchor=east] {3};
\draw[dashed,-latex] (0.5,0.4) -- +(-2.4in,-0.5in)node[anchor=east] {4};
\end{scope}
\end{tikzpicture}
\end{document}
![enter image description here](https://i.stack.imgur.com/L3ght.png)
You can use this inside regular fu=igure
s/subfigure
s like this. I have modified the minipage
dimensions. Roll it back in your case. Also, it is better to use \centering
than \begin{center}... \end{center}
.
\documentclass{article}
\usepackage{subfig}
\usepackage{tikz}
\tikzset{mynode/.style={draw,solid,circle,inner sep=1pt}}
\begin{document}
\begin{figure}[tph]
\subfloat[figure 1 description]{%
\begin{minipage}{0.4\columnwidth}%
\centering
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0,0) {\includegraphics[width=0.5\columnwidth]{example-image-a}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\draw[dashed,-latex] (0.8,0.8) -- +(1.1cm,0.2cm)node[mynode,anchor=west] {1};
\draw[dashed,-latex] (0.6,0.6) -- +(1.9cm,0)node[mynode,anchor=west] {2};
\draw[dashed,-latex] (0.4,0.5) -- +(-2cm,0)node[mynode,anchor=east] {3};
\draw[dashed,-latex] (0.5,0.4) -- +(-2.4cm,-0.5cm)node[mynode,anchor=east] {4};
\end{scope}
\end{tikzpicture}
\end{minipage}
}\hfill{}
\subfloat[mentioned figure from question]{
\centering
\begin{minipage}{0.4\columnwidth}%
\centering
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0,0) {\includegraphics[width=0.5\columnwidth]{example-image-B}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\draw[dashed,-latex] (0.8,0.8) -- +(1.1cm,0.2cm)node[mynode,anchor=west] {1};
\draw[dashed,-latex] (0.6,0.6) -- +(1.9cm,0)node[mynode,anchor=west] {2};
\draw[dashed,-latex] (0.4,0.5) -- +(-2cm,0)node[mynode,anchor=east] {3};
\draw[dashed,-latex] (0.5,0.4) -- +(-2.4cm,-0.5cm)node[mynode,anchor=east] {4};
\end{scope}
\end{tikzpicture}
\end{minipage}
}
\caption{de}
\end{figure}
\end{document}
![enter image description here](https://i.stack.imgur.com/pMWXm.png)
You can define a style
for the node
like
\tikzset{mynode/.style={draw,solid,circle,inner sep=1pt}}
and use it like
\draw[dashed,-latex] (0.8,0.8) -- +(1.1cm,0.2cm)node[mynode,anchor=west] {1};
addendum from @Hug:
the answer helped very much, but I wanted to also show the complete answer to get a desired result which also has the happy side effects of:
- image scale agnosticism (through relative positions, not cm)
- white filled circled numbers, so one can put them inside a figure (achieved through style options)
- use of styles to easily color the lines according to a color scheme (I used Adobe kuler web app for a custom color scheme for me)
- no arrow endings of the lines (no -latex option)
this results in the following MWE (with 8 different colors to choose from):
\documentclass{scrbook}
\usepackage{tikz}
%colors
\definecolor{1c1}{RGB}{188,162,6}
\definecolor{1c2}{RGB}{137,129,80}
\definecolor{1c3}{RGB}{239,167,31}
\definecolor{1c4}{RGB}{88,194,241}
\definecolor{1c5}{RGB}{6,180,188}
% stiles used
\tikzset{mynode/.style={draw=black,solid,circle,fill=white,inner sep=2pt, thick, text=black}}
%draw=black to get a black circle, fill=white so it actually has a
%background and text=black to not get that rendered in the specified color
\tikzset{arrow line/.style={dashed, line width= 2.5pt, color=#1}}
%color is given as a paramter so one can put these two styles in the
%preamble and easily use throughout the document, line width as it was to small on my images on a page
\begin{figure}[tbph]
\hspace{5mm}\subfloat[figure a]{%
\begin{minipage}[b][1\totalheight][c]{0.4\columnwidth}%
\noindent \begin{center}
\includegraphics[width=1\columnwidth]{path/to/image_a}
\par\end{center}%
\end{minipage}
}\hfill{}\subfloat[description of figure a]{\noindent \centering%
\begin{minipage}[b][5cm][c]{0.4\columnwidth}%
\noindent \begin{center}
\centering
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0,0) {\includegraphics[width=0.7\columnwidth]{path/to/image}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
% uncomment the 4 lines for a grid to help with positioning
% \draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
% \draw[help lines,xstep=.05,ystep=.05] (0,0) grid (1,1);
% \foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }
% \foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y};}
% uncomment until line above
\draw[arrow line=1c1] (0.8,0.8) -- +(0.275,0)node[mynode,anchor=west] {\Large 1};
%1c1 is the code for the color, you can enter 1c2 here, too
\draw[arrow line=1c1] (0.6,0.55) -- +(0.475,0)node[mynode,anchor=west] {\Large 2};
\draw[arrow line=1c1] (0.35,0.45) -- +(-0.425,0)node[mynode,anchor=east] {\Large 3};
\draw[arrow line=1c1] (0.375,0.275) -- +(-0.45,-.15)node[mynode,anchor=east] {\Large 4};
\end{scope}
\end{tikzpicture}
\par\end{center}%
\end{minipage}
}\hspace{5mm}
\protect\caption{outside caption}
\end{figure}
which results in this image:
![final resulting image](https://i.stack.imgur.com/i7j9f.png)
So, thanks a lot to Harish Kumar, without whose help this hadn't been possible for me.
Best Answer
There are subtle points relating to the basline aligment.
In the answer by moospit, no baseline is specified for the circled nodes, so they will be using the bottom of the circle as alignment. This produces bad results when used with other characters in the same line:
If we add a
baseline
key to the\tikz
command it still doesn't work right, because the nodes have no real content because it is typeset vialabel
, and thus the baseline of each node is through its center:In a comment, I proposed to simply add a
minimum size
key to the node. This is basically what Harish Kumar does in its answer. This approach correctly aligns the baseline of the text insde each node with the baseline of the line. However, for the node containing only "p", the circle around it is not properly placed:This is because that node has descenders, but not ascenders. This can be fixed if each node includes a
\strut
which is an invisible line of the appropiate height. The\strut
can be included as part of the\circled
command: