【问题标题】:Small Caps for Gnuplot LabelsGnuplot 标签的小型大写字母
【发布时间】:2020-02-02 00:36:18
【问题描述】:

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

【问题讨论】:

  • 一个不可靠的解决方法是使用类似set label "{/:=16 M}YLABEL" font ",12"的东西。

标签: pdf gnuplot smallcaps


【解决方案1】:

我想出了一个解决方法,使用 @mjp@theozhthis answer 中使用的相同策略。

# 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

结果

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-11
    • 1970-01-01
    • 2013-02-04
    • 1970-01-01
    相关资源
    最近更新 更多