0
点赞
收藏
分享

微信扫一扫

使用LaTex画折线图


学术论文画图工具,Excel画出来显的不专业,Matlab体积太大,还收费。直接用LaTex里的包画,很美观。

\usepackage{pgfplots} %引用包
\begin{figure}[!h] %插入图片
\centering %图片居中\begin{tikzpicture} %tikz图片
\begin{axis}[
xlabel=x, %横坐标名
ylabel=y, %纵坐标名
tick align=outside, %刻度在外显式
legend style={at={(0.5,-0.2)},anchor=north} %图例在图下方显示
]%第一条线,mark是折线标示形状
\addplot[smooth,mark=*,blue] plot coordinates {
(20,1)
(40,2)
(60,3)
(80,4)
(100,5)
};%图例里名字
\addlegendentry{case 1}%第二条线,mark是折线标示形状
\addplot[smooth,mark=triangle,cyan] plot coordinates {
(20,1.3)
(40,2.3)
(60,3.3)
(80,4.3)
(100,5.3)
};
\addlegendentry{case 2}\end{axis}
\end{tikzpicture}
\caption{figure name}
\label{fig:name}
\end{figure}

使用LaTex画折线图_折线

举报

相关推荐

0 条评论