Menu

#2175 x2label y-offset

None
closed-fixed
nobody
v5.4 (25)
2020-07-16
2019-05-24
Klaus
No

There is a problem with the y-offset of the x2label. The offset value has a different effect if it is equal or larger than minus unity, then it has for values below -1. It seems that, up to -1.0, it is placed above the x2tics, and below -1.0, it is placed below the tics. The effect, thus, is more dramatic if you have rotated x2tics. This prevents the manual placement of the x2label close to the x2tics.

Code snippet as minimal working example:

set x2tics  # rotate by 90
set x2label "X2" offset 0,-1.0
plot x**2
set x2label "X2" offset 0,-1.01
plot x**2

(I'm using gnuplot 5.2 patchlevel 2 on Windows 10.)

Discussion

  • Ethan Merritt

    Ethan Merritt - 2019-05-24

    Unfortunately it is much more complicated than that. The plot layout calculation has to allow for axis labels, tic labels, the tics themselves, graph borders, timestamp placement, and probably other things I am forgetting. Sometimes the combination of those elements triggers a discrete (rather than continuous) change in placement for one of those as you adjust something else. It may help help to fix the plot border while tweaking other things

    set tmargin at screen 0.9
    

    In this particular case I can suggest another work-around by forcing the x2label to be treated as larger than it really is:

      set x2label "X2\n"  offset 0, <val>
    
     

    Last edit: Ethan Merritt 2019-05-24
  • Klaus

    Klaus - 2019-05-27

    Thanks for the explanation, the work-around with the linebreak is very helpful.

     
  • Ethan Merritt

    Ethan Merritt - 2020-04-14
    • status: open --> pending-fixed
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2020-07-16
    • Labels: --> v5.4
    • Status: pending-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB