Gnuplot set term display window MacOS 上 qt 的错误
Gnuplot set term display window bug with qt on MacOS
问题陈述:
我在 gunplot 中使用 qt term 来做一些图表,但是我得到以下错误:显示 window 出现一微秒然后消失,而终端吐出以下内容: 'qt.qpa.fonts: Populating font family aliases took 260 ms. Replace uses of missing font family "Sans" with one that exists to avoid this cost.' -- 选项下面代码中的 1.0
我尝试过的:
尝试了多个修复,包括更改字体,即下面代码中的选项 1.1。改成 Helvetica 或 Verdana 后,错误消失,但没有显示 window.
有什么解决办法吗?
到目前为止,我可以使用 png 术语保存图表 -- 选项 1.2,所有其他术语似乎产生与 qt 相同的错误。所需的解决方案是具有功能显示 window 以避免打开 saved.png.
P.S 使用 Mac OS,版本 10.15.4 Catalina。相同的代码以前在旧 OS 和旧版本的 Gnuplot 上工作过 x11/aquaterm 支持,当前 OS 和 brew 安装不支持。
提前谢谢大家!!!
一些代码(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
您需要使用 -p
选项告诉 gnuplot
到 "persist" 您的情节:
gnuplot -p <<EOF
...
...
EOF
您还可以考虑将以下内容添加到您的登录脚本以始终 select qt
输出:
export GNUTERM=qt
问题陈述: 我在 gunplot 中使用 qt term 来做一些图表,但是我得到以下错误:显示 window 出现一微秒然后消失,而终端吐出以下内容: 'qt.qpa.fonts: Populating font family aliases took 260 ms. Replace uses of missing font family "Sans" with one that exists to avoid this cost.' -- 选项下面代码中的 1.0
我尝试过的: 尝试了多个修复,包括更改字体,即下面代码中的选项 1.1。改成 Helvetica 或 Verdana 后,错误消失,但没有显示 window.
有什么解决办法吗?
到目前为止,我可以使用 png 术语保存图表 -- 选项 1.2,所有其他术语似乎产生与 qt 相同的错误。所需的解决方案是具有功能显示 window 以避免打开 saved.png.
P.S 使用 Mac OS,版本 10.15.4 Catalina。相同的代码以前在旧 OS 和旧版本的 Gnuplot 上工作过 x11/aquaterm 支持,当前 OS 和 brew 安装不支持。
提前谢谢大家!!!
一些代码(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
您需要使用 -p
选项告诉 gnuplot
到 "persist" 您的情节:
gnuplot -p <<EOF
...
...
EOF
您还可以考虑将以下内容添加到您的登录脚本以始终 select qt
输出:
export GNUTERM=qt