I'm having some trouble using meta in pgfplots. I want to add an asterisk above some of the bars to show significance. I've plotted my bar plots from a table and I've tried assigning a column of the table to correspond to meta but it doesn't seem to work and after a good search I can't find anyone who has answered this question...
Check out my code at the bottom. I would be super grateful for some help.
Thank you for your time.
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{float}
\usepackage{tikz}
\usepackage{caption}
\begin{figure}[h]
\begin{subfigure}[b]{1\textwidth}
\centering
\begin{tikzpicture}[trim axis left, trim axis right]
\begin{axis}[
legend pos=north west,
xlabel= Monensin Treatment (hrs),
ylabel= GAPDH Normalised Expression,
bar width={1cm},
ymin=0,
ymax=8,
title = {PENK Expression},
width=12cm,
height=6cm,
ytick={0,0.5,1,1.5},
ymin=0,
ymax=1.5,
xtick={1,2,3,4},
xticklabels={%
Ctrl,
1,
6,
24
},
grid=none,
ybar, enlarge x limits={abs=1},
]
\addplot[
fill=blue!25,
draw=black,
point meta=y,
every node near coord/.style={inner ysep=5pt},
error bars/.cd,
y dir=both,
y explicit,
point meta=explicit symbolic,
]
table [y error=error, point meta=meta] {
x y error label meta
1 1.0128 0.07 1
2 0.371 0.055 2 ***
3 0.30 0.0941 3
4 0.224 0.0348 4
};
%\node [above, black, font=\Large] at (axis cs: 0.371) {$\ast$}
\draw ({rel axis cs:0,0}|-{axis cs:0,0}) -- ({rel axis cs:1,0}|-{axis cs:0,0});
\end{axis}
\end{tikzpicture}
\caption{}
\end{subfigure}
\\\vspace{0.5cm}
\begin{subfigure}[b]{1\textwidth}
\centering
\begin{tikzpicture}[trim axis left, trim axis right]
\begin{axis}[
legend pos=north west,
ylabel= Ct Mean,
xlabel= Monensin Treatment (hrs),
bar width={1cm},
title = {GAPDH Control},
width=12cm,
height=6cm,
ytick={0,10,20,30},
ymin=0,
ymax=30,
xtick={1,2,3,4},
xticklabels={%
Ctrl,
1,
6,
24
},
grid=none,
ybar, enlarge x limits={abs=1},
]
\addplot[
fill=red!25,
draw=black,
point meta=y,
every node near coord/.style={inner ysep=5pt},
error bars/.cd,
y dir=both,
y explicit
]
table [y error=error] {
x y error label
1 20.45 4.152 1
2 23.54 0.368 2
3 22.71 0.492 3
4 23.82 0.221 4
};
\draw ({rel axis cs:0,0}|-{axis cs:0,0}) -- ({rel axis cs:1,0}|-{axis cs:0,0});
\end{axis}
\end{tikzpicture}
\caption{}
\end{subfigure}
\label{fig:penkexpression}
\caption{}
\end{figure}