I would like to mark my nodes in a graph without using colors because it will be printed in black and white. For example by drawing a vertical line in the first vertex, a horizontal line in the second, two lines in the third,… . Or if there is a better way to do this, I would like to here it.
Thank you for your time.
\documentclass[a4paper,11pt,titlepage]{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{figure*}[h!]
\centering
\begin{tikzpicture}[node distance=1.5cm,>=stealth',bend angle=45,auto]
\node[minimum size=0.5cm, draw,circle,font=\sffamily\Large\bfseries,fill=red!20,inner sep=0.05cm] (1) {$v_{1}$};
\node[minimum size=0.5cm, draw,circle,font=\sffamily\Large\bfseries,fill=green!20,inner sep=0.05cm, below of=1, xshift=2cm] (2) {$v_{2}$};
\node[minimum size=0.5cm, draw,circle,font=\sffamily\Large\bfseries,fill=cyan!20,inner sep=0.05cm,right of=2, xshift=1cm] (3) {$v_{3}$};
\node[minimum size=0.5cm, draw,circle,font=\sffamily\Large\bfseries,fill=purple!30,inner sep=0.05cm,below of=2, xshift=1.5cm] (5) {$v_{5}$};
\node[minimum size=0.5cm, draw,circle,font=\sffamily\Large\bfseries,fill=red!20,inner sep=0.05cm,below of=2, xshift=-2cm] (4) {$v_{4}$};
\end{tikzpicture}
\end{figure*}
\end{document}
Best Answer
Instead of patterns, I would recommend that you use a combination of different shadings, and line styles (
thin
,thick
,ultra thick
, or evendraw=none
) to distinguish the nodes. You can also adjust the text color (as suggested by @Jake), and use dotted or dashed lines (a few of which are probably to be avoided):