在gnuplot epslatex(multiplot)中更改ytic字体大小 [英] Changing ytic font size in gnuplot epslatex (multiplot)

查看:224
本文介绍了在gnuplot epslatex(multiplot)中更改ytic字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在epslatex gnuplot中更改ytics(以及xtics)的字体大小时遇到​​问题.

I have problems changing the font size of my ytics (xtics as well) in an epslatex gnuplot.

我尝试设置格式y '\tiny{%g}' 它仅适用于两个情节中的第一个情节.

I tried set format y '\tiny{%g}' It is only working for the first of the two plots.

这是我的代码:

set terminal epslatex
set output "w_alt_nsyB_multi.tex"
set multiplot layout 1,1
set xrange [-0.5:17]
set yrange [0:110]
set xlabel "days" 
set ylabel "Survival (\\%)" offset 2.5
set key reverse 
set xtics font 'Arial,4' s
et style histogram errorbars gap 2 lw 1
set style data histogram
set style fill solid 1 border lt -1
set boxwidth 0.8
plot 'w_alt_nsyB.dat' every ::::7 using 2:3:xticlabels(1) title 'w1118'  lt rgb "#000000",\
  'w_alt_nsyB.dat' every ::::7 using 4:5 title 'wtSYN'  lt rgb "#FF0000",\
'w_alt_elav_endoG.dat' every ::::7 using 6:7 title '38085'  lt rgb "#9400D3"
set origin 0.5, 0.25
set size 0.5, 0.5
set xrange [-0.5:6]
set yrange [0:110]
set xlabel "\\tiny{Time of $Mn^{2+}$ treatment}"
set ytics ('10'10,'50'50,'100'100) nomirror
unset border
set xtics nomirror
unset ylabel
unset key
plot 'w_alt_nsyB_100.dat' using 2:3:xticlabels(1) lt rgb "#000000",\
 'w_alt_nsyB_100.dat' using 4:5:xticlabels(1) lt rgb "#FF0000",\
 'w_alt_nsyB_100.dat' using 6:7:xticlabels(1) lt rgb "#9400D3"
unset multiplot

有人可以帮我吗?

推荐答案

如果您像使用

set ytics ('10'10,'50'50,'100'100)

您必须只给出标签的位置

You must either just give the locations of the labels

set format y '\tiny %g'
set ytics (10, 50, 100)

或在每个手动标签中包含字体宏

or include the font macro in every manual label

set ytics ('\tiny 10' 10, '\tiny 50' 50, '\tiny 100' 100)

还请注意,您的语法\tiny{%g}是错误的,\tiny只是一个开关,不带任何参数.在这种情况下,这无关紧要,因为每个标签都包裹在一个单独的LaTeX盒子中,但是在其他情况下,则有很大的不同.要包装小字体,通常需要{\tiny %g}.

Note also, that your syntax \tiny{%g} is wrong, \tiny is only a switch and doesn't take any arguments. In this case it doesn't matter, because every label is wrapped in an individual LaTeX box, but in other situations it makes a big difference. To wrap the tiny font you would usually need {\tiny %g}.

xticlabel设置的显式标签也是如此.同样在这里,set format x中的格式也不适用.不必给xticlabel提供列号(如您的示例中的xticlabel(1)),您必须提供完整的标签字符串,包括宏:

The same happens for the explicit labels which are set with xticlabel. Also here, the format from set format x doesn't apply. Instead of giving a column number to xticlabel (like xticlabel(1) in your example), you must give the complete label string including the macro:

xl(c) = sprintf('\tiny %s', strcol(c))
plot 'file.dat' using 2:3:xticlabel(xl(1))

下次,请举一个 minimum 示例,该示例可让其他人重现您的问题.我们没有您的数据文件来运行脚本.而且您的问题与您的特定数据文件无关,因此您也可以使用函数构造示例,这可能会导致您自己找到解决方案...

Next time, please give a minimal example which allows others to reproduce your problem. We don't have your data files to run the script. And your problem isn't related to you specific data file, so you can as well construct an example using functions, which possibly leads you itself to the solution...

这篇关于在gnuplot epslatex(multiplot)中更改ytic字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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