我怎样才能创建如下由 Microsoft Excel 生成的图表?
答案1
我不知道如何从图像中复制粘贴,但这里有一个将您的评论转回 Excel 的示例。
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepackage{eurosym} %<-- For EURO symbol
\usepackage{filecontents} %<-- To create the data file on the go
\begin{filecontents*}{data.csv}
in gdp gni
1990 1732502852 1768116213
1991 1768900924 1812780422
1992 1761774062 1810912926
1993 1717739533 1760435709
1994 1737565752 1781786117
1995 1760478791 180583803
1996 1789413624 1829719306
1997 1842918632 1885167049
1998 1894645346 193721716
\end{filecontents*}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=0.9\textwidth,
height=4cm,
ymajorgrids,
title = {Greece: GDP \& GNI (2005 data)},
x tick label style={/pgf/number format/1000 sep=},
ytick scale label code/.code={$\times$bn\EUR{}},
legend pos=outer north east
]
\addplot table[x=in,y=gdp] {data.csv};\addlegendentry{GDP}
\addplot table[x=in,y=gni] {data.csv};\addlegendentry{GNI}
\end{axis}
\end{tikzpicture}
\end{document}