3

Update: I want to include some pgfplots in the TikZposter but I seem to have some problem. I earlier had a problem with reading the files but as per the suggestion of @percusse, I moved the data outside the node and it worked. But, now I get the plots which are visually bad.

The code I'm working on is as follows:

\documentclass{a0poster}

\usepackage{fancytikzposter} 
\usepackage{tikz,pgfplots}
\usepackage{pgfplotstable}
\usepackage{filecontents}
\pgfplotsset{compat=newest}

\usepackage[backend=bibtex,style=ieee,sorting=none]{biblatex}
\addbibresource{mybibfile.bib}
\usepackage[hidelinks]{hyperref}

\setmargin{2.7}
\definecolor{mycol}{HTML}{116699} 
\definecolor{myblue}{HTML}{003E2F} 
\setfirstcolor{myblue}% default 116699
\usepackage[margin=\margin cm, paperwidth=84.1cm, paperheight=118.9cm]{geometry}
\usepackage{cmbright}
    \usepackage[math]{kurier}
    \usepackage[T1]{fontenc}

%%%----------- Data ----------------%%%
        \pgfplotstableread{
    S   wQoS    QoS
    27  570 570
    54  3098    5020
    81  29578   36476
    108 51040   57860
    135 62493   65508
    162 100736  107670
    189 117150  122174
    }\objnomQoS
    \pgfplotstableread{
    S   wQoS    QoS
    27  570     570
    54  8128    8161
    81  43404   43416
    108 64830   64806
    135 72442   78292
    162 114619  125415
    189 129120  143916
    }\objrobQoS

    \usepackage{hyperref}
    \begin{document}

\ClearShipoutPicture
\AddToShipoutPicture{\BackgroundPicture}

\noindent % to have the picture right in the center
\begin{tikzpicture}
  \initializesizeandshifts

  \ifthenelse{\equal{\template}{1}}{ 
    \titleblock{76}{1}
  }{
    \titleblock{47}{1.5}
  }

     \blocknode{Results}%
  {

\pgfplotsset{width=\linewidth}
\begin{tikzpicture}
\begin{axis}[legend style={at={(0.5,-0.25)},
                     anchor=north, legend columns=-1},
             enlarge y limits=0.02, ybar, bar width=3pt,
             xlabel=No. of VNF chains $|S|$,
             ylabel=Objective Function,
             grid=both,
             xtick=data,
             ymin=0, ymax=150000,
             grid style={line width=0.1pt, draw=gray!10},
             major grid style={line width=0.2pt, draw=gray!50},
             minor tick num=10,
             legend entries={w/o QoS, with QoS}]
\addplot+ [line width=0.5pt] table[x=S, y=wQoS] {\objnomQoS};
\addplot+ [line width=0.5pt] table[x=S, y=QoS] {\objnomQoS};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[legend style={at={(0.5,-0.25)},
                     anchor=north, legend columns=-1},
             enlarge y limits=0.02, ybar, bar width=3pt,
             xlabel=No. of VNF chains $|S|$,
             ylabel=Objective Function,
             grid=both,
             xtick=data,
             ymin=0, ymax=150000,
             grid style={line width=0.1pt, draw=gray!10},
             major grid style={line width=0.2pt, draw=gray!50},
             minor tick num=10,
             legend entries={w/o QoS, with QoS}]
\addplot+ [line width=0.5pt] table[x=S, y=wQoS] {\objrobQoS};
\addplot+ [line width=0.5pt] table[x=S, y=QoS] {\objrobQoS};
\end{axis}
\end{tikzpicture}
%\caption{Objective function values for the nominal ($\Gamma=0$) scenario (left side) and the robust scenario ($\Gamma=4$) (right side) - \textsc{Abilene} Network.}
%\label{fig:nomQoSrob}
  }

\end{tikzpicture}
\end{document}

The plots look weird. What am I doing wrong? Thank You enter image description here

  • 2
    In blocknode probably new line character is omitted as a regular tikz node. Read the tables outside the nodes and typeset it later in the node. – percusse May 13 '16 at 7:41
  • I'll give it a try and get back @percusse – crypto May 13 '16 at 7:42
  • 2
    Unrelated note: The author of fancytikzposter.sty recommends to use the tikzposter class instead, the package will not be maintained. – Torbjørn T. May 13 '16 at 9:11
  • Move the table reading to the preamble. – Torbjørn T. May 13 '16 at 9:13
  • I did in the original document but it didn't have an impact on the plots – crypto May 13 '16 at 9:20
3

I suggest switching to the tikzposter class, which is partly based on the fancytikzposter package. The former does not have the same problem.

\documentclass[a0paper]{tikzposter}
\usetheme{Rays}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.13}

\pgfplotstableread{
S   wQoS    QoS
27  570 570
54  3098    5020
81  29578   36476
108 51040   57860
135 62493   65508
162 100736  107670
189 117150  122174
}\objnomQoS
\pgfplotstableread{
S   wQoS    QoS
27  570     570
54  8128    8161
81  43404   43416
108 64830   64806
135 72442   78292
162 114619  125415
189 129120  143916
}\objrobQoS

\author{Someone}
\title{Something}
\begin{document}
\maketitle[width=0.95\textwidth,linewidth=0pt]
\begin{columns}
\column{0.5}
\block{Title}{
\pgfplotsset{width=0.9\linewidth}
\begin{tikzpicture}
\begin{axis}[legend style={at={(0.5,-0.12)},
                     anchor=north, legend columns=-1,column sep=1cm},
             enlarge y limits=0.02, ybar, bar width=3pt,
             xlabel=No. of VNF chains $|S|$,
             ylabel=Objective Function,
             grid=both,
             xtick=data,
             ymin=0, ymax=150000,
             grid style={line width=0.1pt, draw=gray!10},
             major grid style={line width=0.2pt, draw=gray!50},
             minor tick num=10,
             legend entries={w/o QoS, with QoS},
  every node/.style={}]
\addplot+ [line width=0.5pt] table[x=S, y=wQoS] {\objnomQoS};
\addplot+ [line width=0.5pt] table[x=S, y=QoS] {\objnomQoS};
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[legend style={at={(0.5,-0.12)},
                     anchor=north, legend columns=-1,column sep=1cm},
             enlarge y limits=0.02, ybar, bar width=3pt,
             xlabel=No. of VNF chains $|S|$,
             ylabel=Objective Function,
             grid=both,
             xtick=data,
             ymin=0, ymax=150000,
             grid style={line width=0.1pt, draw=gray!10},
             major grid style={line width=0.2pt, draw=gray!50},
             minor tick num=10,
             legend entries={w/o QoS, with QoS}]
\addplot+ [line width=0.5pt] table[x=S, y=wQoS] {\objrobQoS};
\addplot+ [line width=0.5pt] table[x=S, y=QoS] {\objrobQoS};
\end{axis}
\end{tikzpicture}
}
\end{columns}
\end{document}

enter image description here

|improve this answer|||||
  • That was swift! Thanks a lot Torbjorn. I shall write you back as soon as I've fixed this problem :) – crypto May 13 '16 at 9:41
  • I was able to reproduce the plots. Thanks a lot for the help. But I couldn't get the style that fancytikzposter gives – crypto May 13 '16 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.