I am aware of several patterns available in tikz patterns, such as vertical lines, crosshatch and etc. However, I need to create some tile pattern similar to that of checkerboard pattern in order to fill a bar chart. I was wondering how can I create such pattern and use it in my plots as simple as other available patterns?
It is noted that the existing checkerboard pattern is not a vector, so it looses quality after zooming.
\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\usetikzlibrary{patterns}
\begin{document}
\definecolor{bblu}{HTML}{4F81BD}
\definecolor{rred}{HTML}{C0504D}
\definecolor{ggre}{HTML}{9BBB59}
\definecolor{ppur}{HTML}{9F4C7C}
\begin{tikzpicture}
\begin{axis}[
width = 0.95*\textwidth,
height = 8cm,
major x tick style = transparent,
ybar=2*\pgflinewidth,
ymode=log,
bar width=6pt,
ylabel = {Running time (Minute)},
symbolic x coords={Data 1,Data 2,Data 3},
xtick = data,
scaled y ticks = false,
enlarge x limits=0.1,
ylabel style={at={(0.04,0.5)}},
x tick label style = {rotate=45},
ymin=1,
ymax=1500,
legend cell align=left,
legend style={
at={(.2,.75)},
anchor=south east,
column sep=.1ex,
nodes={scale=0.6, transform shape},
}
]
\addplot
[area legend, style={cyan,fill=cyan,mark=none}]
coordinates {(Data 1, 22) (Data 2, 22) (Data 3, 22)};
\addplot
[area legend, style={rred,fill=rred,mark=none, pattern=checkerboard, pattern color=rred}]
coordinates {(Data 1, 22) (Data 2, 22) (Data 3, 22)};
\addplot
[area legend, style={ggre,fill=ggre,mark=none, pattern=vertical lines, pattern color=ggre}]
coordinates {(Data 1, 0.1) (Data 2, 0.1) (Data 3, 0.1)};
\legend{Alg 1,Alg 2,Alg 3}
\end{axis}
\end{tikzpicture}
\end{document}
This is what I get after zooming:

104 - Patternsexplains the use of command\pgfdeclarepatternformonlywith some examples. These patterns can be used ifpgfplotsas is shown in http://tex.stackexchange.com/a/229251/1952 – Ignasi May 31 '16 at 17:57checkerboardand zoomed in to the maximum my PDF viewer supports (1,600%) and I don't see any loss of quality in the result. Of course, the pattern isn't a vector. But nor is it bitmap. Rather it isn't an image at all so this is just irrelevant. Something like a category mistake, I suppose. – cfr Jun 01 '16 at 01:49vertical linesas vector, butcheckerboardfuzzy. – orezvani Jun 01 '16 at 02:56