我想用我的 Latex 数据绘制一个以 2 为底数的对数图形。它绘制的是一条直线,而它应该绘制的是一条曲线。
\begin{gnuplot}[terminal = latex, terminaloptions = {size 2.8in,3.0in}]
set mxtics 2
set mytics 2
set key left top
set xrange[1.0:0]
set yrange[1.6:1.62]
set xlabel "User selected parameter $t_0$"
set ylabel "\\rotatebox{90}{Validation Error (\\%)}"
plot "data" u 1:(log(5)) with linespoint lc "black" title "abc"
有人能帮我吗?我正在 Overleaf 上绘制这个。
答案1
您可能想写u 1:(log($5))
(注意$
)。
\documentclass{article}
\usepackage{gnuplottex}
\begin{document}
\begin{gnuplot}[terminal = latex, terminaloptions = {size 2.8in,3.0in}]
set mxtics 2
set mytics 2
set key left top
set xrange[1.0:0]
set yrange[1.6:1.62]
set xlabel "User selected parameter $t_0$"
set ylabel "\\rotatebox{90}{Validation Error (\\%)}"
plot "data.dat" u 1:(log($5)) with linespoint lc "black" title "abc"
\end{gnuplot}
\end{document}
这是我化好的妆data.dat
。
0.0 0 0 0 5.00
0.1 0 0 0 5.01
0.2 0 0 0 5.02
0.3 0 0 0 5.03
0.4 0 0 0 5.02
0.5 0 0 0 5.01
0.6 0 0 0 5.00
0.7 0 0 0 5.01
0.8 0 0 0 5.02
0.9 0 0 0 5.03
1.0 0 0 0 5.02