1

I am trying to plot a bar chart like below:

\documentclass{standalone}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
%\usepackage{subcaption}
\definecolor{blues1}{RGB}{198, 219, 239}
\definecolor{blues2}{RGB}{158, 202, 225}
\definecolor{blues3}{RGB}{107, 174, 214}
\definecolor{blues4}{RGB}{49, 130, 189}
\definecolor{blues5}{RGB}{8, 81, 156}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
 symbolic x coords={$\tau =5$,$\tau = 10$,$\tau =15$,$\tau =20$, $\tau =25$},
xtick={$\tau =5$,$\tau =15$, $\tau =25$},
%x tick label style={
%/pgf/number format/1000 sep=},
ylabel=$\mathcal{R}_{\max}$,
ytick ={0.9, 0.92, ..., 1},
xlabel = Size of the Time Window,
%enlargelimits=0.15,
%legend style={at={(0.5,-0.1)},anchor=north},
legend style={at={(0.65,1)},
anchor=north,legend columns=-1},
ybar,
bar width=5.8pt,]
\addplot[style={fill=blues3,mark=none}] 
coordinates {($\tau =5$,0.90) ($\tau =15$,0.91)
($\tau =25$,0.9011) };\addlegendentry{run=1}
\addplot[style={fill=blues2,mark=none}]
coordinates {($\tau =5$,0.9465) ($\tau =15$,0.925)
($\tau =25$,0.9314) };\addlegendentry{ run=2}
\addplot[style={fill=blues1,mark=none}]
coordinates {($\tau =5$,0.98) ($\tau =15$,0.977)
($\tau =25$,0.97) };\addlegendentry{run=3}
\end{axis}
\end{tikzpicture}

\end{document}

what I want is to fill the bars with some distinguishable patterns so that if the document is printed as black and white the figure will be understandable. How can I do that? Thanks.

0

0

Browse other questions tagged .