我运行以下脚本(仅显示脚本的主要部分)
# set-up
nutc = 1.0 # torque
# legend
set key top right
# 1st x axis
set xlabel 't in d^2/{/Symbol n}'
set format x "%.1f"
set xrange [0.0: 1.0]
set xtics 0.0, 0.5
set mxtics 2
# 1st y axis
set ylabel 'Nu_{/Symbol w}'
set format y "%.1f"
set yrange [-0.2: 3.0]
set ytics -1.0, 1.0
set mytics 5
# grid lines
set nogrid
# line styles with colours appropriate for colour-blind
set style line 10 lc rgb '#000000' dt 2 lw 1.5 # black
set style line 11 lc rgb '#D55E00' dt 1 lw 1.5 # vermillon
set style line 12 lc rgb '#0072B2' dt 1 lw 1.5 # blue
set style line 13 lc rgb '#009E73' dt 1 lw 1.5 # bluish green
set style line 14 lc rgb '#E69F00' dt 1 lw 1.5 # orange
set style line 15 lc rgb '#56B4E9' dt 1 lw 1.5 # sky blue
set style line 16 lc rgb '#CC79A7' dt 1 lw 1.5 # reddish purple
set style line 17 lc rgb '#F0E442' dt 1 lw 1.5 # yellow
# main plot
set style data lines
plot nutc t 'solution' ls 10,\
'torque' u ($1):($2) t 'Inner' ls 11,\
'torque' u ($1):($3) t 'Outer' ls 12
# convert to pdf (epstopdf comes with e.g. TeXlive)
system('epstopdf '.file)
运行时弹出以下错误
错误原因是什么以及如何修复? [我想线条样式设置部分中的所有 8 行都存在同样的问题:第 43-50 行]
根据StackOverflow规则“评论中没有答案”,我总结一下:
您有一个相当旧的 gnuplot 版本 4.6.2 (2013),它不允许在线条样式设置中设置 dashtype (
dt
)。也许有不同的方法或解决方法,但最简单的可能是更新到较新版本的 gnuplot,请参阅:https://sourceforge.net/projects/gnuplot/files/gnuplot/
在 gnuplot 控制台中输入
set term
,您将看到可用的终端。这就是我得到的:
Available terminal types:
cairolatex LaTeX picture environment using graphicx package and Cairo backend
canvas HTML Canvas object
cgm Computer Graphics Metafile
context ConTeXt with MetaFun (for PDF documents)
domterm DomTerm terminal emulator with embedded SVG
dumb ascii art for anything that prints text
dxf dxf-file for AutoCad (default size 120x80)
emf Enhanced Metafile format
epscairo eps terminal based on cairo
epslatex LaTeX picture environment using graphicx package
fig FIG graphics language V3.2 for XFIG graphics editor
gif GIF images using libgd and TrueType fonts
hpgl HP7475 and relatives [number of pens] [eject]
jpeg JPEG images using libgd and TrueType fonts
lua Lua generic terminal driver
mf Metafont plotting standard
mp MetaPost plotting standard
pcl5 PCL5e/PCL5c printers using HP-GL/2
pdfcairo pdf terminal based on cairo
pict2e LaTeX2e picture environment
png PNG images using libgd and TrueType fonts
pngcairo png terminal based on cairo
postscript PostScript graphics, including EPSF embedded files (*.eps)
pslatex LaTeX picture environment with PostScript \specials
pstex plain TeX with PostScript \specials
pstricks LaTeX picture environment with PSTricks macros
qt Qt cross-platform interactive terminal
sixelgd sixel using libgd and TrueType fonts
svg W3C Scalable Vector Graphics
texdraw LaTeX texdraw environment
tikz TeX TikZ graphics macros via the lua script driver
tkcanvas Tk canvas widget
unknown Unknown terminal type - not a plotting device
windows Microsoft Windows
wxt wxWidgets cross-platform interactive terminal
根据您的目的,请勾选
help cairolatex
、help epscairo
、help epslatex
和 help pdfcairo
。