Preventing tic labels from resizing graph in gnuplot

后端 未结 1 1285
耶瑟儿~
耶瑟儿~ 2021-01-26 06:50

I\'m trying to make a general plot where I don\'t know the range. Sometimes there will be more zero\'s or a \"-\" on the tic marks, which causes the graph area to contract. I

相关标签:
1条回答
  • 2021-01-26 07:32

    You can use set lmargin to set a fixed left margin. With e.g. set lmargin 10 you fix the left margin to 10 character widths:

    set multiplot layout 2,1
    set lmargin 10    
    set xrange [0:10]
    plot x
    
    set xrange[0:100000]
    plot x
    unset multiplot
    

    enter image description here

    Of course, you must still find an appropriate setting for the left margin size.

    As another point, also the label position depends on the ticlabel length.

    set multiplot layout 2,1
    set lmargin 10
    set ylabel 'ylabel'
    
    set xrange [0:10]
    plot x
    
    set xrange[0:100000]
    plot x
    unset multiplot
    

    enter image description here

    So you would need to change the ylabel position with the offset parameter. To have it more general, you can put the ylabel with a usual set label command to have it fixed independent of the margin settings:

    set multiplot layout 2,1
    set lmargin 10
    set label 1 'manual label' at screen 0.03,graph 0.5 center rotate by 90
    
    set xrange [0:10]
    plot x
    
    set xrange[0:100000]
    plot x
    unset multiplot
    

    enter image description here

    0 讨论(0)
提交回复
热议问题