Gnuplot:图例密钥框中左侧不需要的空白 [英] Gnuplot: Unwanted white space on the left side in legend key box
问题描述
请查看从Gnuplot创建的附件图.我面临着两个问题.
Please have a look at the attached plot created from Gnuplot. I am facing two issues with it.
1)钥匙箱(图例箱)左侧的空白区域.有什么办法可以消除多余的空白?我既不想丢失钥匙箱,也不想折衷所用的希腊字母.另外,请注意,最终输出格式必须为eps.
1) The empty white space in the left side of the key box (legend box). Is there any way to remove that extra empty white space? Neither I want to lose the key box nor compromise on the Greek letters used. Also, note that final output format has to be eps.
2)y轴和y标签之间也有太多空间.如何优化呢? 请帮忙.
2) There is also too much space between the y-axis and the y-label. How to optimize it? Please help.
推荐答案
Gnuplot不知道最终格式化的字符串的确切宽度和高度.而是尝试根据一些字体信息来估算宽度.当使用例如qt
终端,其标题仅包含非常狭窄的字母:
Gnuplot doesn't know the exact width and height of the ultimately formatted strings. It rather tries to approximate the width based on some font information. That does also happen when using e.g. the qt
terminal with a title containing only very narrow letters:
set terminal qt
set key box
plot x title 'iiiiiiiiiii'
当涉及TeX字符串时,这变得更加复杂.将width
参数用于set key
,并使用较小的值以减小键的宽度.您必须手动估算要使用的实际值:
That becomes even more complictated when TeX strings are involved. Use the width
parameter for set key
with a narrow value to decrease the key's width. You must manually estimate the actual value to use:
set terminal qt
set key box width -6
plot x title 'iiiiiiiiiii'
相同的论点适用于xlabel
和ylabel
的位置.在这里,您必须使用offset
参数来更正位置:
The same argumentation applies to the positioning of xlabel
and ylabel
. Here, you must use the offset
parameter to correct the position:
set xlabel 'xlabel' offset 0, -0.5
set ylabel 'ylabel' offset 0.5, 0
这篇关于Gnuplot:图例密钥框中左侧不需要的空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!