I have the following code which roughly approximates a diagram I want to make with tikz:
\begin{tikzpicture}
\begin{axis}[
% (normal text should not be set in math mode)
xlabel=,
ylabel=,
% if you use `data' ticks will be set on every x coordinate that is
% given by the *first* `\addplot' command
xtick=data,
xticklabels={
Control,
Voucher,
Transfer%
},
ytick=data,
yticklabels={
No increase,
Increase%
},
% use the following key so the baseline of all ticklabel entries is the same
% (compare this image to the one from marmot)
typeset ticklabels with strut,
% there is one default value for the `legend pos' that is outside the axis
legend pos=outer north east,
% (so the legend looks a bit better)
legend cell align=left,
% (moved this common key here),
]
% (renamed `plot coordinates' by `coordinates'
\addplot [mark=*,blue] coordinates {
(1,1)
(2,1)
(3,1)
};
\addplot [color=red,mark=x] coordinates {
(1,1)
(2,1)
(3,2)
};
\addplot [color=green,mark=x] coordinates {
(1,1)
(2,2)
(3,2)
};
% (replaced `\addlegendentry's with `\legend')
\legend{
Pure Altruism,
Warm Glow,
Mental Accounting,
}
\end{axis}
\end{tikzpicture}
As you can see, I have attempted to add y axis tick labels, but this has not emerged in the actual diagram itself. Further, what I am trying to illustrate is discrete in nature, so I want there to be three adjacent bars for each tick on the x axis that will illustrate whether the level should be 'high' or 'low' under each of the theories in the legend.
How can I convert this to a bar chart with three adjacent bars and add the two y axis labels I need?