I'd like to put a second xlabel on a grouped bar graph using TiKz but can't seem to work it out. So I have found this cm superfonts package: http://ctan.org/pkg/cm-super. Or I can download cm fonts directly to my pc (but they're in a format I can't open and I've tried everything) http://sourceforge.net/projects/cm-unicode/
I'm intending to make my graph> export to Adobe illustrator or inkscape and write my group labels in there:
% This file was created by matlab2tikz v0.3.2.
% Copyright (c) 2008--2013, Nico Schlömer <nico.schloemer@gmail.com>
% All rights reserved.
%
% The latest updates can be retrieved from
% http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
% where you can also make suggestions and rate matlab2tikz.
%
%
%
\documentclass[tikz,border=3pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{plotmarks}
\begin{document}
\definecolor{mycolor1}{rgb}{0.0416666666666667,0,0}
\begin{tikzpicture}
\begin{axis}[%
width=11.0276041666667in,
height=5.87479166666667in,
area legend,
scale only axis,
xmin=0, xmax=25,
xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40},
xticklabels={E,P,H,N,F,,E,P,H,N,F,,E,P,H,N,F,,E,P,H,N,F,},
ymin=0, ymax=2,
ylabel={CFU cm$^2$},
legend style={draw=black,fill=white,legend cell align=left},yticklabel style={/pgf/number format/fixed},
]
\addplot[ybar,bar width=0.10082380952381in,bar shift=-0.063014880952381in,fill=mycolor1,draw=black] plot coordinates{(1,0.04485625)
(2,1.881133333)
(3,1.197503086)
(4,1.842835802)
(5,0.3139072)
(6,0)
(7,0.04485625)
(8,0.002466667)
(9,0.578984568)
(10,0.003676543)
(11,0.3139072)
(12,0)
(13,0.000628571)
(14,0.001266667)
(15,0.576515432)
(16,0.001048457)
(17,0.30285028)
(18,0)
(19,0.04485625)
(20,0.001266667)
(21,0.576762346)
(22,0.002796914)
(23,0.30285028)};
\addlegendentry{4 ac.h$^{-1}$};
\addplot [
color=black,
solid,
forget plot
]
table{
0 0
25 0
};
\addplot[ybar,bar width=0.10082380952381in,bar shift=0.063014880952381in,fill=white,draw=black] plot coordinates{(1,0.04265625)
(2,0.595466667)
(3,0.499092593)
(4,0.401030556)
(5,0.170007298)
(6,0)
(7,0.04265625)
(8,0.000133333)
(9,0.306561728)
(10,0.000462346)
(11,0.170007298)
(12,0)
(13,5e-05)
(14,0.0002)
(15,0.306561728)
(16,0.000462346)
(17,0.159355735)
(18,0)
(19,0.04265625)
(20,0.0002)
(21,0.306592593)
(22,0.000777778)
(23,0.159355735)};
\addlegendentry{6 ac.h$^{-1}$};
\end{axis}
\end{tikzpicture}%
\end{document}
Like this:


matlab2tikz, you could use the approach from http://tex.stackexchange.com/questions/55554/how-can-i-mix-an-ybar-and-an-ybar-stacked-with-pgfplots and its follow-up Draw group line error. – Jake Apr 18 '13 at 20:01\node[right, inner sep=0mm, text=black] at (axis cs:3, -0.2, 0) {Patient 1};Any ideas (though this is an understatement :)) how to get a red line like above? – HCAI Apr 18 '13 at 20:24\pgfplotsset{ after end axis/.code={ \draw [red, thick] ({rel axis cs:0,0}-|{axis cs:6,0}) +(0pt,4ex) -- ++(0pt,-4ex); } }inside youraxisenvironment. You could make that easier by wrapping the code in a new command. – Jake Apr 18 '13 at 20:30