I want to cycle colours for each x co-ordinate in a bar plot. Is it possible? For instance, in this example I want each metric to appear in a different colour.
This question Colors and legend in groupplots/barplot does something very similar except that in my case for every loop, I want to add two bars (one light shade and one dark shade colour).
\documentclass{article}
\usepackage[hscale=0.9]{geometry}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{calc,shapes.geometric,arrows,fit,matrix,positioning,pgfplots.groupplots,trees,patterns}
\begin{document}
\begin{figure*}
\begin{tikzpicture}
\begin{groupplot}[group style={group size= 3 by 2,xticklabels at=edge bottom},height=5cm,width=5cm,ybar=1pt,xtick=data,tick label style={font=\scriptsize},x tick label style={rotate=45,anchor=east}
,symbolic x coords={metric1,metric2,metric3,metric4,metric5,metric6}, ylabel style={align=center}]
\nextgroupplot[title=a,ylabel={set1}, bar width=5pt]
\addplot[fill=blue!40] table[x=metric,y=a1,col sep=space] {colourData1.csv};
\addplot[fill=blue!80] table[x=metric,y=a2,col sep=space] {colourData1.csv};
\nextgroupplot[title=b,bar width=5pt]
\addplot[fill=blue!40] table[x=metric,y=b1,col sep=space] {colourData1.csv};
\addplot[fill=blue!80] table[x=metric,y=b2,col sep=space] {colourData1.csv};
\nextgroupplot[title=c,bar width=5pt]
\addplot[fill=blue!40] table[x=metric,y=c1,col sep=space] {colourData1.csv};
\addplot[fill=blue!80] table[x=metric,y=c2,col sep=space] {colourData1.csv};
\coordinate (mtop) at (rel axis cs:0,1);% coordinate at top of the first plot
\nextgroupplot[ylabel={set2}, bar width=5pt]
\addplot[fill=blue!40] table[x=metric,y=a1,col sep=space] {colourData2.csv};
\addplot[fill=blue!80] table[x=metric,y=a2,col sep=space] {colourData2.csv};
\nextgroupplot[bar width=5pt]
\addplot[fill=blue!40] table[x=metric,y=b1,col sep=space] {colourData2.csv};
\addplot[fill=blue!80] table[x=metric,y=b2,col sep=space] {colourData2.csv};
\nextgroupplot[bar width=5pt]
\addplot[fill=blue!40] table[x=metric,y=c1,col sep=space] {colourData2.csv};
\addplot[fill=blue!80] table[x=metric,y=c2,col sep=space] {colourData2.csv};
\coordinate (mbot) at (rel axis cs:1,0);% coordinate at bottom of the last plot
\end{groupplot}
\path (mtop-|current bounding box.west)-- node[anchor=south,rotate=90,yshift=-0.9cm] {\small Common} (mbot-|current bounding box.west);
\end{tikzpicture}
\caption{group plot with each plot in a different colour}
\label{fig:metrics}
\end{figure*}
\end{document}
Update
For a single plot inside this group plot, there are six metrics. For each metric there are two bars. For example in the top left plot, for all 6 metrics, a1 and a2 are plotted. Similarly for the bottom right plot c1 and c2 are plotted.
I would like to have each metric plotted in a different colour. But the two bars for a metric should be plotted with a dark and light shade of same colour.
Note: I'm ok with transposing the input data if that is easier to plot.
colourData1.csv:
metric a1 a2 b1 b2 c1 c2
metric1 30 60 50 100 50 100
metric2 40 80 60 120 25 50
metric3 50 100 80 160 60 120
metric4 60 120 60 120 89 178
metric5 70 140 25 50 20 40
metric6 80 160 30 60 23 46
colourData2.csv is a clone of colourData1.csv

