# Two consequence bars in a chart

I have bar chart that consists of 4 bars. I want to add extra four bars so that I can compare the result of each algorithm before and after a certain modification. the bar I have is the following:

and I want something like this (Except that each 2 bars has the same color so each algorithm before and after has the same color):

The code of my first image is:

 \documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[margin=0.5in]{geometry}

%-------------------------------------------------------
%Pseudo Code
\floatname{algorithm}{Pseudo Code}

%-------------------------------------------------------
%Bar chart
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{bchart}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{subfig}
\pgfplotsset{compat=1.10}

\definecolor{RYB2}{RGB}{245,245,245}%رمادي
\definecolor{RYB1}{RGB}{218,232,252}%
\definecolor{RYB3}{RGB}{252,252,252}%
\definecolor{RYB4}{RGB}{108,142,191}%كحلي غامق
\definecolor{RYB5}{RGB}{85, 114, 155}%
\definecolor{RYB6}{RGB}{67, 94, 132}%

%------------------------------------------------------
%Tiks figure
\usetikzlibrary{fit, backgrounds, matrix, arrows.meta}
\tikzset{
startstop/.style={
rectangle, rounded corners, minimum width=1.8cm,
minimum height=1.5cm,text centered, draw=black, fill=RYB2
},
process/.style={
rectangle, minimum width=3.95cm, minimum height=1cm, text centered, draw=black, fill=RYB1
},
arrow/.style={
black,-{Stealth[length=6pt]}
},
arrowlabel/.style={
midway, above, inner ysep=2pt
},
dasharrow/.style={
black, dashed,-{Stealth[length=6pt]}
}
}

\newcommand\stupidfbox[1]
{%
\fbox{\scantokens{#1\ignorespaces}}%
}

\begin{document}

\begin{figure}[H]
\centering

\begin{tikzpicture}
\begin{axis}[symbolic x coords={alg1,, alg2,,alg3,, alg4},
xticklabel style={rotate=45,anchor=north east},
xtick={alg1,, alg2,,alg3,, alg4},
ylabel=Measure(\%),
ymajorgrids,
bar width=17pt,
]

\end{axis}
\end{tikzpicture}
\caption{Figure name}
\label{fig:results_1}
\end{figure}

\end{document}


Does anyone knows how can I achieve that?

Thank you

Welcome to TeX.SE! Most of the efforts in writing this went into removing things that were not needed. And to get the result, I moved ybar to the axis options and then added the plots without it.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=0.5in]{geometry}
\usepackage{pgfplots}
\usepackage{float}
\pgfplotsset{compat=1.10}

\definecolor{RYB2}{RGB}{245,245,245}%AAAAAAAAAAAAAAA
\definecolor{RYB1}{RGB}{218,232,252}%
\definecolor{RYB3}{RGB}{252,252,252}%
\definecolor{RYB4}{RGB}{108,142,191}%AAAAAAAAAAAA AAAAAAAAAAAA
\definecolor{RYB5}{RGB}{85, 114, 155}%
\definecolor{RYB6}{RGB}{67, 94, 132}%

\begin{document}
\begin{figure}[htb]
\centering
\begin{tikzpicture}
\begin{axis}[symbolic x coords={alg1,, alg2,,alg3,, alg4},
xticklabel style={rotate=45,anchor=north east},
xtick={alg1,, alg2,,alg3,, alg4},
ylabel=Measure(\%),
ymajorgrids,
bar width=17pt,ybar,enlargelimits=0.1
]