You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Gnuplot 5.4预览显示圆角虚线,保存为SVG/PDF后丢失问题求助

Gnuplot圆角虚线保存SVG/PDF丢失问题的解决方法

核心原因

wxt终端的round参数是其自身独有的渲染特性,SVG和PDF终端并不识别该参数,需要针对这两类终端使用专门的rounded选项来启用圆角虚线。

具体解决方案

针对不同终端分别配置参数:

  • 预览用wxt终端:保留原设置即可
    set terminal wxt round enhanced
    
  • SVG终端:使用rounded替代round,并确保开启enhanced
    set terminal svg enhanced rounded
    set output "your_plot.svg"
    replot
    
  • PDF终端:使用pdfcairo终端(Gnuplot推荐的PDF输出终端),同样添加rounded选项
    set terminal pdfcairo enhanced rounded
    set output "your_plot.pdf"
    replot
    

完整示例脚本

# 1. 启动预览窗口
set terminal wxt round enhanced title "Preview"
set output
plot sin(x) with lines dashtype 2 linewidth 2 title "Rounded Dashed Line"

# 2. 保存为SVG
set terminal svg enhanced rounded size 800,600
set output "rounded_dash.svg"
replot

# 3. 保存为PDF
set terminal pdfcairo enhanced rounded size 6,4
set output "rounded_dash.pdf"
replot

注意事项

  • Gnuplot 5.4版本的SVG和pdfcairo终端原生支持rounded选项,无需额外配置
  • 切换终端后务必执行replot命令,确保所有绘图参数生效
  • 若虚线样式仍有差异,可明确指定dashtype编号或自定义虚线模式(如dashtype [10,5])

内容的提问来源于stack exchange,提问作者Ghaith Nadhreen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 19:20:13