我的顾问告诉我,下面的图表只是在 Excel 中绘制的,并不具有科学性。
其代码:
\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{pgfplots}
\usepackage{tikz}
\begin{document}
\IEEEraisesectionheading{\section{Introduction}\label{sec:introduction}}
\begin{figure}[htp]
\centering
\begin{tikzpicture}
\begin{axis}
[width=7.5cm,xlabel={Number of data files},ylabel={Cost},grid=major,domain=1:35,xmin=0,xmax=35,ymin=172636,ymax=1810000,
xtick={0,5,...,35},ytick={0,250000,...,1800000},legend pos=north west,samples=10,grid style=dashed]
\addplot {100 + x * 50000}; \addlegendentry{$P1$};
\addplot {100 + x * 55000}; \addlegendentry{$P2$};
\end{axis}
\end{tikzpicture}
\vspace*{-2mm}
\caption{Costs of on different sizes.}
\label{fig:gas_limit}
\end{figure}
\end{document}
相反,我是否可以绘制一个更像 IEEE 风格的图表,但它看起来不像在 Excel 中绘制的那样。
IEEE 样式的图形视图示例如下(我从几篇 IEEE 论文中找到它们)。请注意,只有它的样式对我来说很重要:
- 色彩论文参考:
- 没有颜色,论文参考:
答案1
您可以根据需要自定义图表。以下是我的尝试:
\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{xcolor}
\definecolor{c1}{RGB}{0,113,188}
\definecolor{c2}{RGB}{217,82,24}
\begin{document}
\IEEEraisesectionheading{\section{Introduction}\label{sec:introduction}}
\begin{figure}[htp]
\centering
\begin{tikzpicture}
\begin{axis}
[width=10cm,height=7cm,xlabel={Number of data files},
ylabel={Cost}, grid=major, domain=1:35, xmin=0, xmax=35,
ymin=200000, ymax=1800000, xtick={0,5,...,35}, ytick={0,200000,...,1800000},
xlabel style={black!70}, ylabel style={black!70},
tick label style={black!70}, tick style={black!50},
axis line style={black!50}, legend style={draw=black!50},
legend pos=north west, samples=10, grid style=solid]
\addplot[c1, very thick, dashed, mark=triangle*,mark size=3,mark options={c1, very thick, solid, fill=white}] {100 + x * 50000}; \addlegendentry{$P1$};
\addplot[c2, very thick, dotted, mark=square*, mark size=3, mark options={c2, very thick, solid, fill=white}] {100 + x * 55000}; \addlegendentry{$P2$};
\end{axis}
\end{tikzpicture}
\vspace*{-2mm}
\caption{Costs of on different sizes.}
\label{fig:gas_limit}
\end{figure}
\end{document}
不过,我同意马金,默认的pgfplots已经足够科学了。