LaTeX barplot: one x-axis, two y-axis

I want to plot a bar plot with LaTeX with the layout that you can see in the picture that I've done with PowerPoint:

I don't want to do a subplot kind of graph since the datasets include the same data but collected in two different moments of an experiment.

Any idea on how to do it?

• Hi, welcome. You could have a look at the pgfplots package and its groupplots library. (Don't have time to write up a solution now, but someone else might.) – Torbjørn T. Feb 24 '17 at 9:01
• Hello and thanks to those who have replied.. Since it seems that my request was too generic, I've posted a follow-up question here: tex.stackexchange.com/questions/355517/… – Davide Feb 24 '17 at 12:55

This is quite an easy task for PGFPlots. Because you weren't very specific for your needs, here I also just present an example on how to do it, using some dummy data copied from the manual.

If you have experimental data in a file and you need to use "symbolic coordinates", please also have a look at Remove the space between bars and axis. And if you really should need a second y-axis, also this can be done. For that have a look at Second y-axis inside groupplot.

Hopefully this gives you at least a good start. If you later need some more assistance in details, please feel free to ask a Follow-up question then.

\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{pgfplots.groupplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}[
group style={
group size=1 by 2,
x descriptions at=edge bottom,
y descriptions at=edge left,
vertical sep=5mm,
},
ybar,
enlargelimits=0.15,
ylabel={\#participants},
xtick=data,
symbolic x coords={tool8,tool9,tool10},
nodes near coords,
]
\nextgroupplot