Gnuplot: Unwanted white space on the left side in legend key box

后端 未结 1 1240
死守一世寂寞
死守一世寂寞 2021-01-14 03:00

Please have a look at the attached plot created from Gnuplot. I am facing two issues with it.

1) The empty white space in the left side of the key box (legend box).

相关标签:
1条回答
  • 2021-01-14 03:30

    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'
    

    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'
    

    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
    
    0 讨论(0)
提交回复
热议问题