[英]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.