# Bringing the parts of a bar chart closer

In the MWE below:

\documentclass{report}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{tikz,pgf}

\usepackage{pgfplots}
\usepackage{slashbox}
\usepackage{bchart}

\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
decorations.pathreplacing,decorations.pathmorphing,shapes,%
matrix,shapes.symbols,automata}

\begin{document}

\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
ybar,
ylabel={Time Elapsed (in hours)},
xlabel={Methods},
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
width=0.7*\textwidth,
height=9cm,
bar width=7pt,
symbolic x coords={Category-1,Category-2},
xtick=data,
ymin=0
]

coordinates {(Category-1,0.27) (Category-2,14.96)};

coordinates {(Category-1,0.37) (Category-2,13.25)};

coordinates {(Category-1,2.76)  (Category-2,29.55)};

coordinates {(Category-1,2.82) (Category-2,16.03)};

\legend{Original, byHalf, Random, Hybrid}
\end{axis}
\end{tikzpicture}
\end{figure}

\end{document}


How can I make the two parts (Category-1 and Category-2) come closer to each other ?

-
Try enlarge x limits=1 – Jake Aug 29 '12 at 13:31
Works great @Jake thanks! if you can put this in an answer I will be happy to accept it ;) – Cemre Aug 29 '12 at 13:36

You can increase the space on either side of the plot by setting enlarge x limits=<value>. Setting enlarge x limits=1 works quite well in this case.