I'd like to build an energy transition diagram (same as Energy level transition pgfplots/Tikz [code below]). However, I would like to add label on it.
\documentclass{standalone}
\usepackage{pgfplots,pgfplotstable}
\usepgflibrary{plotmarks}
\usetikzlibrary{calc}
%%% Label to insert
\pgfplotstableread{
one two three
R R R
C1 nan C2
TS1 TS2 TS3
C3 C4 C5
P1 P2 P3
}\labeltable
%%% Start of the code for energy level
%%% Example data file
\pgfplotstableread{
one two three
0.0 0.0 0.0
-64.2 nan -10
150.4 155.8 47
54.4 63.9 -156
113.9 172.4 -56
}\datatable
\begin{document}
\begin{tikzpicture}[x=2cm, y=0.2mm]
\begin{axis}[
%only marks,
every axis plot post/.style={mark=-,ultra thick,mark size=4mm},
ylabel=Energy (kJ.mol$^{-1}$),
xtick=\empty,
legend pos=outer north east,
xmin=-0.5,
xmax=5,
ymin=-200,
%ymax=350,
axis lines=left,
xtick=\empty,
hide x axis,
legend entries={\small one, \small two,\small three},
legend style={draw=none},
title=Insert better title here,
% Extra options added
anchor=origin,
disabledatascaling,
only marks,
x=2cm, y=0.2mm,]
\pgfplotstablegetcolsof{\datatable}
\pgfmathsetmacro\numberofycols{\pgfplotsretval-1}
\pgfplotsinvokeforeach {0,...,\numberofycols}{
\addplot table[x expr=\coordindex, y index=#1] {\datatable};
}
\end{axis}
% Extra code added
\foreach \case in {one,two,three} {
\xdef\previndex{0}
\xdef\prevlevel{0}
\pgfplotstableforeachcolumnelement{\case}\of\datatable\as\level{%
\pgfmathfloatparsenumber{\level}
\pgfmathfloatgetflagstomacro\pgfmathresult\flags
\ifnum\flags=3\relax\else
\draw[densely dotted,thick] ($(\previndex,\prevlevel)+(0.2,0)$) -- ($(\pgfplotstablerow,\level)+(-0.2,0)$);
\xdef\previndex{\pgfplotstablerow}
\xdef\prevlevel{\level}
\fi
}
}
\end{tikzpicture}
\end{document}
Indeed, I would like to add energy values (from the table \datatable) and the level labels (from the table \labeltable) on the energy level like the figure below :
Many thanks in advance

