I'm new to LaTeX and I have a lot of small problems that all cause failure:
- I want my y-axis to start at 0 (not at -something arbitraty which it is now). I have tried ymin=0, but it does not respond.
- I want to use '<' instead of 'before'. I have tried
\textless
, but that gives me an error "TeX capacity exceeded, sorry [input stack size=5000]" I want the y-label to have a subscript:
ylabel={Installed capacity (MW\textsubscript{p})}
But this does not work
I want to remove the ticks on the top and right of the figure.
- I want the bar labels to be easily readable (it's fine if the figure becomes wider)
Basically, I want to go from this excel graph into a nice LaTeX graph:
My code:
\documentclass[11pt, twoside, a4paper]{report}
\usepackage[left = 20mm, right = 20mm, top = 20mm, bottom = 20mm]{geometry}
\usepackage{apacite}
\usepackage{pgfplots}
%\pgfplotsset{compat=1.5}
\begin{document}
\chapter{Introduction}
\begin{tikzpicture}
\begin{axis}[
ybar,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-10},
ylabel={Installed capacity (MWp)},
symbolic x coords={before2014, 2014, 2015, 2016, 2017},
xtick=data,
nodes near coords,
nodes near coords align={vertical},
]
\addplot coordinates {(before2014, 1.7) (2014, 3.0) (2015, 49.5) (2016,
70.7) (2017, 396.5)};
\addplot coordinates {(before2014, 1.7) (2014, 4.7) (2015, 54.2) (2016,
124.9)(2017, 521.4)};
\legend{Annual installed capacity, Cumulative installed capacity}
\end{axis}
\end{tikzpicture}
\end{document}
My graph so far: