Preventing tic labels from resizing graph in gnuplot

百般思念 提交于 2019-12-02 16:10:00

问题


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 would prefer the tic labels just extend farther to the left preserving the graph size. This helps with alignment which is a crucial part of these plots.

Does anyone have an idea about how to do this? My searches haven't revealed anything yet.


回答1:


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

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

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



来源:https://stackoverflow.com/questions/27278475/preventing-tic-labels-from-resizing-graph-in-gnuplot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!