1

我正在寻找一个命令或等效于在 Gnuplot 中使用小型大写字母绘制标签的命令,例如\texsc{Mylabel}在 LaTeX 中使用。如果不使用乳胶作为终端,是否有机会这样做?我更喜欢直接生成 PDF。

4

1 回答 1

3

我想出了一个解决方法,使用@mjp@theozh这个答案中使用的相同策略。

# Implements a 'textsc' function like in (La)TeX.
# Based on original answer at https://stackoverflow.com/a/54174759/11369382

reset
set encoding utf8 # mandatory

LCases="abcdefghijklmnopqrstuvwxyz"
SCases="ᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡxʏᴢ"

toscchr(c)= c eq ""  ?  ""  :  substr( SCases.c, strstrt(LCases.c, c), strstrt(LCases.c, c) )

texsc(s) = strlen(s) <= 1 ? toscchr(s) : texsc(s[1:strlen(s)/2]).texsc(s[(strlen(s)/2)+1:strlen(s)])

Mylabel = "The Quick Brown Fox jumps over the Lazy Dog"

position = "at graph 0.2,0.60"

set label Mylabel        @position offset 0, 0
set label texsc(Mylabel) @position offset 0,-1

plot x w p pt -1 not

结果

结果

于 2020-02-01T16:36:18.030 回答