# Show my results bar chart in latex

I have a results of my research in the form of a bar chart created from excel work sheet. The image of my excel sheet and bar chart is given in the figure below;

• Search in forum. Many examples provided by experts can be found, for example: tex.stackexchange.com/a/126577/31034 – ferahfeza May 1 '14 at 12:25
• Open a terminal and type texdoc pgfplots. The PDF opening contains a lot of information. You will be able to do your above plot in very short time. – LaRiFaRi May 1 '14 at 14:17

This is an attempt, where the data is read in via pgfplotstableread, since the data has two parallel axis label, a way to work around is to draw the plot twice and change the xticklabelon the second plot. Furthermore, this solution applies shadows.blur from tikzlibrary to have the shadow effects in order to mimic the shadow effect in the OP. the parameters x/yshift below can be changed to meet your need. As can be seen in the OP, the second labels were overlapped and this is improved by the width=15cm in the axis options, which can also be adjusted to meet one's need.

blur shadow={shadow yshift=0pt, shadow xshift=2pt}


Code:

\documentclass[border=10pt]{standalone}
\usepackage{pgf,pgfplots}
\usepackage{tikz,pgfplotstable}
\pgfplotsset{compat=1.8}
\begin{document}
\definecolor{darkblue}{HTML}{003366}
\def\mystrut{\vphantom{pb}}

items,section_1,section_2
max,centroid,82
max,bisector,82
max,mom,84
max,lom,84
max,som,71
sum,centroid,82
sum,bisector,82
sum,mom,80
sum,lom,79
sum,som,71
prob,centroid,82
prob,bisector,82
prob,mom,80
prob,lom,79
prob,som,71
}\datatable

\begin{tikzpicture}
\begin{axis}[ybar=2pt, bar width=10pt,
height=5cm, width=15cm,
enlarge y limits=false,
ymin=64, ymax=85,
xtick=data,
xticklabels from table={\datatable}{section_1},
x tick label style={rotate=90, xshift=-1cm,yshift=-0.2cm, anchor=south,font=\small,align=center},
]
table[x expr=\coordindex, y=section_2, ] {\datatable};
\end{axis}

\begin{axis}[ybar=2pt, bar width=10pt,
height=5cm, width=15cm,
enlarge y limits=false,
ymin=64,  ymax=85,
xtick=data,
xticklabels from table={\datatable}{items},
x tick label style={yshift=-2.2cm,anchor=south,font=\mystrut,align=center},
]

• OK, you need to copy this file and put it into your current directory tikzlibraryshadows.blur.code.tex - TeXdoc.net. I used this keyword shadow.blur, latex search in the internet. Use pdflatex to compile. – Jesse May 1 '14 at 15:06