I want hop1 to hop 6 tiles on every group of bars but i am unable to create it. Similarly I want to add similar title on trendlines drawn for every hop. Your help in this regard would be highly appreciated.
Thank you.
Below is the compileable code attached
\RequirePackage{filecontents}
\begin{filecontents*}{hop1}
1pkt/5sec 492
1pkt/10sec 483
1pkt/20sec 479
1pkt/30sec 420
1pkt/40sec 493
1pkt/50sec 500
\end{filecontents*}
\begin{filecontents*}{hop2}
1pkt/5sec 457
1pkt/10sec 409
1pkt/20sec 440
1pkt/30sec 50
1pkt/40sec 490
1pkt/50sec 498
\end{filecontents*}
\begin{filecontents*}{hop3}
1pkt/5sec 407
1pkt/10sec 438
1pkt/20sec 399
1pkt/30sec 322
1pkt/40sec 412
1pkt/50sec 497
\end{filecontents*}
\begin{filecontents*}{hop4}
1pkt/5sec 63
1pkt/10sec 156
1pkt/20sec 370
1pkt/30sec 331
1pkt/40sec 357
1pkt/50sec 496
\end{filecontents*}
\begin{filecontents*}{hop5}
1pkt/5sec 90
1pkt/10sec 206
1pkt/20sec 368
1pkt/30sec 323
1pkt/40sec 379
1pkt/50sec 490
\end{filecontents*}
\begin{filecontents*}{hop6}
1pkt/5sec 56
1pkt/10sec 240
1pkt/20sec 0
1pkt/30sec 324
1pkt/40sec 376
1pkt/50sec 484
\end{filecontents*}
\documentclass[conference]{IEEEtran}
\ifCLASSINFOpdf
\else
\fi
\usepackage[pdftex]{graphics}
\usepackage{pgfplots,pgfplotstable}
\usetikzlibrary{patterns}
\usepgfplotslibrary{dateplot}
\usepackage{cite}
\usepackage{url}
\usepgfplotslibrary{patchplots}
\pgfplotsset{compat=1.7}
\hyphenation{op-tical net-works semi-conduc-tor}
\pgfplotstableread{hop1}\a
\pgfplotstableset{create on use/x/.style={create col/expr={\pgfplotstablerow}}}
\pgfplotstableread{hop2}\b
\pgfplotstableset{create on use/x/.style={create col/expr={\pgfplotstablerow}}}
\pgfplotstableread{hop3}\c
\pgfplotstableset{create on use/x/.style={create col/expr={\pgfplotstablerow}}}
\pgfplotstableread{hop4}\d
\pgfplotstableset{create on use/x/.style={create col/expr={\pgfplotstablerow}}}
\pgfplotstableread{hop5}\e
\pgfplotstableset{create on use/x/.style={create col/expr={\pgfplotstablerow}}}
\pgfplotstableread{hop6}\f
\pgfplotstableset{create on use/xnum/.style={create col/expr={\pgfplotstablerow}}}
\begin{document}
\begin{figure*}[t]
\begin{tikzpicture}
\begin{axis}[
height=6cm, width=13.5cm,
%x tick label style={rotate=45},
ybar,
bar width=0.2cm,
xlabel={Pkt Generation Rate},
ylabel={Pkt Delivery Ratio},
ymin=0, ymax=500,
symbolic x coords={1pkt/5sec,1pkt/10sec,1pkt/20sec,1pkt/30sec,1pkt/40sec,1pkt/50sec},
xtick=data,
ytick={0,100,200,300,400,500,600},
legend style={font=\small},
legend pos=outer north east,
ymajorgrids=true,
legend columns=2,
%legend style={at={(0.5,0.5)}},
%grid style=dashed,
]
\addplot[red!20!black,fill=black!80!white] table {\a};
\addlegendentry{Hop-1};
\addplot+[smooth,black!80,line width=1pt]table [y={create col/linear regression={x=x}}] {\a};
\addlegendentry{Trendline hop-1};
\addplot[red!20!black,fill=blue!80!white] table {\b};
\addlegendentry{Hop-2};
\addplot+[smooth,blue!80,line width=1pt] table [y={create col/linear regression={x=x}}] {\b};
\addlegendentry{Trendline hop-2};
\addplot[red!20!black,fill=red!80!white] table {\c};
\addlegendentry{Hop-3};
\addplot[smooth,red!80,line width=1pt] table [y={create col/linear regression={x=x}}] {\c};
\addlegendentry{Trendline hop-3};
\addplot[red!20!black,fill=orange!80!white] table {\d};
\addlegendentry{Hop-4};
\addplot[smooth,orange!80,line width=1pt] table [y={create col/linear regression={x=x}}] {\d};
\addlegendentry{Trendline hop-4};
\addplot[red!20!black,fill=green!80!white] table {\e};
\addlegendentry{Hop-5};
\addplot[smooth,green!80,line width=1pt] table [y={create col/linear regression={x=x}}] {\e};
\addlegendentry{Trendline hop-5};
\addplot[red!20!black,fill=cyan!80!white] table {\f};
\addlegendentry{Hop-6};
\addplot[smooth,cyan!100,line width=1pt] table [y={create col/linear regression={x=x}}] {\f};
\addlegendentry{Trendline hop-6};
\end{axis}
\end{tikzpicture}
\end{figure*}
\end{document}
Here is the output
I want 1 written on top of every black bar, 2 on every blue bar and so on. Example is attached