gnuplot - 无法在 gnuplot 中绘制直线而不显示不同的点类型
问题描述
我正在使用 gnuplot 绘制一个图形,但该图不断给我不同的点类型而不是直线。我想只使用直线绘制它们,但不断得到 x 或加号或不同的符号。这是我对 gnuplot 脚本的内容。
set terminal pdf
set output "temperatures.pdf"
set style line 1 lc rgb "red" lt 1
set style line 2 lc rgb "blue" lt 1
set style line 3 lc rgb "purple" lt 1
set style line 4 lc rgb "orange" lt 1
set style line 5 lc rgb "cyan" lt 1
set xrange [0:780]
set yrange [0:88]
set xlabel "Time (s)"
set ylabel "Temperature (°C)"
set key bottom right
plot "data.dat" using 6:1 ls 1 notitle, "data.dat" using 6:2 ls 2 notitle, "data.dat" using 6:3 ls 3 notitle, "data.dat" using 6:4 ls 4 notitle, "data.dat" using 6:5 ls 5 notitle, \
NaN ls 1 title "600 MHz", NaN ls 2 title "800 MHz", NaN ls 3 title "1100 MHz", NaN ls 4 title "1300 MHz", NaN ls 5 title "1500 MHz"
解决方案
有不同的绘图样式,例如with points
、with lines
和with linespoints
许多其他样式。您还可以通过和w p
缩写样式。检查。如果您不指定任何内容,则默认为. 这就是你得到的。设置线型或线型并不一定意味着您只绘制一条线。您还必须明确使用.w l
w lp
help with
with points
with lines
顺便说一句,您可以通过指定''
. 并且为了可读性,您可以通过用分隔来编写多行\
(注意,\
必须是行中的最后一个字符,之后不允许有空格或其他字符)。
尝试以下操作:
plot "data.dat" u 6:1 w l ls 1 title "600 MHz", \
'' u 6:2 w l ls 2 title "800 MHz", \
'' u 6:3 w l ls 3 title "1100 MHz", \
'' u 6:4 w l ls 4 title "1300 MHz", \
'' u 6:5 w l ls 5 title "1500 MHz"
推荐阅读
- python - 为什么尽管放置了 subplot() 方法却没有显示情节?
- c# - 浮点数组到excel中的列(范围)
- git - 如何签出(下载)git存储库目录内的单个文件
- python - 如何使用烧瓶 python 以 JSON 格式发送原始数据。在 params 中发送数据时,它将数据作为表单数据(键值对)发送
- python - 水平图例表的动态宽度 - Plotly Express
- netsuite - 从 Netsuite 自定义 Excel 导出
- c++ - C++ WaveOut API 模糊测试声音
- sql - For count of records having more than 1 retrieve the least value
- javascript - 我需要进行按钮加载...在点击和加载之前的同时...检查所需的验证
- python - 使用带有 python 的 youtube api 发布 youtube 评论,每次询问“授权此应用程序”