Just after an hour spending browsing through the pgfplots manual, I am trying to have a figure and a table side by side (both the figure and the table use the same data). So I still have lot to learn!
So here is apples.dat file:
%Apples that went bad
year value
2008 12053 %31 Dec 2007
2009 15792 %31 Dec 2008
2010 22907 %31 Dec 2009
2011 30997 %31 Dec 2010
And here are my plot commands:
\documentclass[12pt]{article}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotsset{width=7cm,height=5cm,compat=newest}
\begin{figure}[h]
\begin{tikzpicture}
\begin{axis}[
enlargelimits=false,
xmin=2008,
xmax=2012,
x tick label style={rotate=45,anchor=east},
mark=x,line width=1pt,
axis y line = none,
nodes near coords,
color=black,
grid=major
]
xlabel=year,
ylabel=value]
\addplot+ file[skip first = true,x=year,y=value,const plot mark right]{apples.dat};
\end{axis}
\end{tikzpicture}
\end{figure}
\pgfplotstabletypeset[columns={year,value}]{apples.dat}
\end{document}
I am saving space by eliminating the y values and tick marks.
Questions:
How to make the figure and the table appear side by side?
If I need to rotate the two floats (figure and table) together at the same time and turn them 90 deg anticlockwise so that the appear in the landscape mode, how to proceed?
I've tried using the
const plot mark rightoption in\addplotbut it doesn't work. Why?Why does the
mark=xoption doesn't work in my code?Why does the
color=blackoption doesn't work in my code?If I want to output everything as an eps file. How to proceed? I have tried using
\usepgfplotslibrary{external} \tikzexternalize% activate externalization!
but this doesn't work with the conventional LaTeX > dvips > ps2pdf route. So how to get an eps?
I am using TeXLive 2011 (with everything updated last week) on Win XP.
Thanks a lot...
