【问题标题】:Gnuplot set term display window bug with qt on MacOSGnuplot 在 MacOS 上使用 qt 设置术语显示窗口错误
【发布时间】:2020-04-03 15:05:03
【问题描述】:

问题陈述: 我在 gunplot 中使用 qt term 做一些图表,但是我得到以下错误:显示窗口出现一微秒并消失,而终端吐出以下内容:'qt.qpa.fonts:填充字体系列别名花了260 毫秒。将缺失字体系列“Sans”的使用替换为现有字体系列以避免此成本。 -- 下面代码中的选项1.0

我尝试过的: 尝试了多个修复,涉及更改字体,即下面代码中的选项 1.1。更改为 Helvetica 或 Verdana 后,错误消失,但没有显示窗口。

关于如何解决它的任何想法?

到目前为止,我可以使用 png 术语保存图形——选项 1.2,所有其他术语似乎会产生与 qt 相同的错误。理想的解决方案是有一个功能显示窗口,以避免打开保存的.png。

P.S 使用 Mac OS,版本 10.15.4 Catalina。以前在旧操作系统和旧版本的 Gnuplot 上使用相同的代码,支持 x11/aquaterm,当前操作系统和 brew install 不支持。

提前谢谢大家!!!

一些代码(下面附上gunplot zsh脚本):

gnuplot  << EOF


# Option 1.0
set terminal qt
# does  Error in commant prompt: qt.qpa.fonts: Populating font family aliases took 252 ms. Replace uses of missing font family "Sans" with one that exists to avoid this cost.   

# Option 1.1 
#set terminal qt font "Helvetica" #  does no error in command prompt, no window displayed

# Option 1.2
#set terminal png
#set output 'saved.png' # saves .png but no window generated


# PARKER WIND
set xr [0.5:2.0]
set yr [0.0:2.5]

set xlabel "r/r_0"
set ylabel "Psi"



set style line 1 lt 1 lc rgb "blue" lw 1 pt 11   
set style line 2 lt 1 lc rgb "black" lw 1   pt 11
set style line 3 lt 1 lc rgb "black" lw 1 pt 7 ps 2
set style line 4 lt 1 lc rgb "blue" lw 1 pt 7 ps 2
set style line 5 lt 1 lc rgb "black" lw 3 pt 7 ps 2

set xzeroaxis



#        MULTIPLE GRAPHS
plot  'outputdata/parker_0.500.dat' u 1:2 with  lines ls 1 title "psi0=0.500"  ,\
      'outputdata/parker_0.550.dat' u 1:2 with  lines ls 1 title "psi0=0.550"  ,\
      'outputdata/parker_0.600.dat' u 1:2 with  lines ls 1 title "psi0=0.600"  ,\
      'outputdata/parker_0.650.dat' u 1:2 with  lines ls 1 title "psi0=0.650"  ,\
      'outputdata/parker_0.700.dat' u 1:2 with  lines ls 1 title "psi0=0.700" ,\
      'outputdata/parker_0.750.dat' u 1:2 with  lines ls 1 title "psi0=0.750" ,\
      'outputdata/parker_0.800.dat' u 1:2 with  lines ls 1 title "psi0=0.800" ,\
      'outputdata/parker_0.850.dat' u 1:2 with  lines ls 1 title "psi0=0.850" ,\


EOF

【问题讨论】:

    标签: macos gnuplot


    【解决方案1】:

    您需要使用-p 选项告诉gnuplot “坚持”您的情节:

    gnuplot -p <<EOF
    ...
    ...
    EOF
    

    您还可以考虑将以下内容添加到您的登录脚本中以始终选择qt 输出:

    export GNUTERM=qt
    

    【讨论】:

    • 优秀 - 请考虑通过单击计票旁边的勾号(复选标记)✅ 接受它作为正确答案。祝你的项目好运!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-09-28
    • 2018-06-13
    • 1970-01-01
    • 2012-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多