浏览代码

Add graph to template

JoostSijm 7 年之前
父节点
当前提交
5fb57c0d8e
共有 1 个文件被更改,包括 31 次插入0 次删除
  1. 31 0
      docs/template_news.tex

+ 31 - 0
docs/template_news.tex

@@ -77,6 +77,37 @@ Een mooie grafiek!
 \color{white}
 \captionof{figure}{Verdeling in het parlement}
 
+\pgfplotstableread[col sep=&, header=true]{%
+    description & DIP & TBL & CB & DCP
+    10-2 & 29.83 & 15.79 & 10.53 & 12.29
+    15-2 & 21.84 & 16.18 &  6.75 & 14.3
+    20-2 & 21.75 & 18.01 & 12.40 & 11.17
+    25-2 & 25.28 & 23.08 & 12.09 & 8.8
+     2-3 & 25.59 & 22.10 & 13.96 & 10.47
+     7-3 & 26 & 22 & 14 & 10
+}\datatableentry{}
+\begin{tikzpicture}
+    \begin{axis}[
+        title 				= Verkiezingen,
+        enlarge y limits	= {value=0.2,upper},
+        xtick				= data,
+        xticklabels			= {10-2,15-2,20-2,25-2,2-3,7-3},
+        x tick label style	= {rotate=-45,anchor=west,font=\tiny},
+        legend style		= {font=\tiny,legend pos=north west,legend cell align=left, fill=none},
+    ]
+        \addlegendentry{DIP};
+        \addplot [loosely dashed] table [y=DIP, x expr=\coordindex] {\datatableentry};
+        \addlegendentry{TBL};
+        \addplot [densely dashed] table [y=TBL, x expr=\coordindex] {\datatableentry};
+        \addlegendentry{CB};
+        \addplot [dotted] table [y=CB, x expr=\coordindex] {\datatableentry};
+        \addlegendentry{DCP};
+        \addplot [dashed] table [y=DCP, x expr=\coordindex] {\datatableentry};
+    \end{axis}
+\end{tikzpicture}
+
+
+
 \noindent\fbox{%
 	\begin{minipage}{\dimexpr\linewidth-12pt\relax}
 		\begin{multicols}{2}