Fonts gnuplot中的一致字体?
我在gnuplot中有以下脚本,除了一些字体问题外,它运行良好Fonts gnuplot中的一致字体?,fonts,gnuplot,Fonts,Gnuplot,我在gnuplot中有以下脚本,除了一些字体问题外,它运行良好 #/usr/bin/env gnuplot #设置 将终端pngcairo增强颜色非透明背景rgb设置为“白色” 设置输出“temp.png” lm=“拉丁现代数学” #射程 设置X范围[-3*pi/2:3*pi/2] 设置Y范围[-1.5:1.5] #标签 设置xlabel“{/Symbol q}(弧度)”字体lm 设置ylabel“sin({/Symbol q})、cos({/Symbol q})”字体lm 设置标题“简单正弦”
#/usr/bin/env gnuplot
#设置
将终端pngcairo增强颜色非透明背景rgb设置为“白色”
设置输出“temp.png”
lm=“拉丁现代数学”
#射程
设置X范围[-3*pi/2:3*pi/2]
设置Y范围[-1.5:1.5]
#标签
设置xlabel“{/Symbol q}(弧度)”字体lm
设置ylabel“sin({/Symbol q})、cos({/Symbol q})”字体lm
设置标题“简单正弦”字体lm
#密谋
用线条绘制sin(x)线条颜色rgb“红色”标题“正弦”,0标题“正弦”
设定输出
如你所见:
标题
之后使用字体
命令,但没有成功与使用相同字体的文档的其余部分(将包含此内容)相同。您可能正在查找
设置键字体lm
。此外,gnuplot应该能够理解utf-8,因此您可以直接在标签中放置θ。因为我没有“拉丁现代数学”,所以我用“Lucida Graphic Italic”和“Courier New”作为插图。另一个选项是在终端中指定字体,例如设置终端pngcairo font”“
。检查帮助pngcairo
代码:
### set fonts
reset session
set terminal pngcairo enhanced color notransparent background rgb "white"
set output "temp.png"
myFont = "Lucida Graphic Italic"
myFont2 = "Courier New"
# range
set xrange [-3*pi/2:3*pi/2]
set yrange [-1.5:1.5]
# labels
set title "Simple Sinusoid" font myFont
set xlabel "θ (radian)" font myFont
set xtics font myFont2
set ylabel "sin(θ), cos(θ)" font myFont
set ytics font myFont2
set key font myFont
# plot
plot sin(x) with lines linecolor rgb "red" title "sine", 0 title ''
set output
### end of code
结果:
### set fonts
reset session
set terminal pngcairo enhanced color notransparent background rgb "white"
set output "temp.png"
myFont = "Lucida Graphic Italic"
myFont2 = "Courier New"
# range
set xrange [-3*pi/2:3*pi/2]
set yrange [-1.5:1.5]
# labels
set title "Simple Sinusoid" font myFont
set xlabel "θ (radian)" font myFont
set xtics font myFont2
set ylabel "sin(θ), cos(θ)" font myFont
set ytics font myFont2
set key font myFont
# plot
plot sin(x) with lines linecolor rgb "red" title "sine", 0 title ''
set output
### end of code