gnuplot中的粗体增强文本 [英] bold enhanced text in gnuplot

查看:622
本文介绍了gnuplot中的粗体增强文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:此问题已在更高版本的gnuplot(> 5.0)中得到解决;见@andyras的答案。

UPDATE: this issue has been resolved in newer versions (>5.0) of gnuplot; see @andyras' answer.

我很难让gnuplot在非postscript中创建带有粗体和增强文本的标签终端。以下脚本

I am having difficulty getting gnuplot to create labels with bold and enhanced text in non-postscript terminals. The following script

#!/usr/bin/env gnuplot

reset

set terminal pdfcairo enhanced color lw 3 size 3,2 font 'Arial-Bold'
set output 'output.pdf'

set tics scale 0

plot -x title 'normal text', \
-2*x t 'enhanced_{text}', \
-3*x t '{/Arial-Bold attempt to specify_{font}}'

set terminal pngcairo enhanced color lw 3 size 400,300 font 'Arial-Bold'
set output 'output.png'
replot

set terminal postscript enhanced color lw 3 size 6,4 font 'Arial-Bold'
set output 'output.eps'
replot

reset

产生以下eps(使用转换为png转换output.eps-旋转90 outputeps.png ):

Produces the following eps (converted to png with convert output.eps -rotate 90 outputeps.png):

这很好。但是,当我使用pdf或png终端时,结果如下所示:

which is fine. However, when I use the pdf or png terminals the result looks like this:

请注意,虽然所有标签文本均应为粗体,但只有没有任何增强文本的标签都为粗体。另外,当我尝试手动指定字体(最后一行标题)时,字体是不同的(还原为默认值吗?)。

Note that while all the label text should be bold, only the label without any enhanced text is bold. In addition, when I try to manually specify the font (last line title) the font is different (reverts to the default?).

这种行为是我应该期待的吗?不使用postscript终端?还有另一种指定字体的方法(即,命名方式是否不同于Postscript)?

Is this behavior I should expect when not using the postscript terminal? Is there another way to specify fonts (i.e. is the naming scheme different outside of postscript)?

推荐答案

自版本5.0起,gnuplot具有处理此问题的新语法:

Since version 5.0, gnuplot has a new syntax to handle this issue:

 "normal text {/Times:Bold boldface-newfont} {/:Italic slanted-default-font } back to normal text"]

这些括号也可以嵌套。

这篇关于gnuplot中的粗体增强文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆