繁体   English   中英

Gnuplot 标签的小写字母

[英]Small Caps for Gnuplot Labels

我正在寻找一个命令或等效的东西来在 Gnuplot 中用小写字母绘制标签,比如在 LaTeX 中使用\\texsc{Mylabel} 有没有机会在不使用乳胶作为终端的情况下这样做? 我更喜欢直接生成PDF。

我在这个答案中使用@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

结果

结果

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM