带有 Times-Roman 字体的 gnuplot 埃标签 [英] gnuplot angstrom label with Times-Roman font

查看:35
本文介绍了带有 Times-Roman 字体的 gnuplot 埃标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm trying to produce a plot where I have the character Å (angstroms) in the x axis. Moreover, I want this character to be in the same font as the rest of the graph, that is I want to use Times-Roman. If I use the following code:

set encoding iso_8859_1
set term postscript eps enhanced color "Times-Roman, 32"
set output "angstroms.eps"
set xlabel "Try1  {A}  ({305})"
plot sin(x)

I obtain this figure:

(note: the figure I get is in eps format, but I have to upload a jpg to stackoverflow)

If I remove the {A}, or change it into anything else like {B} I get this:

Finally, if I write:

set xlabel "Try1   (/E {305})"

I get where the Å symbol changed to sans serif font.

What's going on? Thanks for any help, Cheers!

/Luca

解决方案

Here two different scripts, which work for me with Debian x86_64:

set encoding utf8 
set term postscript eps enhanced color "Times-Roman, 32"
set output "angstroms-utf8.eps"
set label at graph 0.1, graph 0.75 "Try1 {A} (Å)"
set label at graph 0.1, graph 0.5 "Try1 {B} (Å)"
set label at graph 0.1, graph 0.25 "Try1 (Å)"
set xlabel "Try1 (Å)"
plot sin(x)

I tested this one with 4.6.3 (needs at least 4.4 because of the utf8 encoding). As angstrom signs I used the LATIN CAPITAL LETTER A WITH RING ABOVE (U+00C5).

The other script is

set encoding iso_8859_1
set term postscript eps enhanced color "Times-Roman, 32"
set output "angstroms.eps"
set label at graph 0.1, graph 0.75 "Try1 {A} ({305})"
set label at graph 0.1, graph 0.5 "Try1 {B} ({305})"
set label at graph 0.1, graph 0.25 "Try1 ({305})"
set xlabel "Try1 ({305})"
plot sin(x)

That one I tested with 4.2.0 and 4.6.3. All variants give the same result:

I obtained that png using:

epstopdf angstroms-utf8.eps && pdftocairo -r 150 -png angstroms-utf8.pdf

这篇关于带有 Times-Roman 字体的 gnuplot 埃标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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