防止tic标签调整gnuplot中图形的大小 [英] Preventing tic labels from resizing graph in gnuplot

查看:72
本文介绍了防止tic标签调整gnuplot中图形的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试绘制一个我不知道范围的一般图.有时,tic标记上会有更多的零或-",这会导致图形区域收缩.我希望tic标签仅向左延伸更远,以保持图形大小.这有助于对齐,这是这些图的关键部分.

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.

推荐答案

您可以使用 set lmargin 设置固定的左边距.与例如设置lmargin 10 ,您可以将左边距固定为10个字符的宽度:

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.

另一方面,标签位置也取决于ticlabel的长度.

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

因此,您需要使用 offset 参数更改ylabel的位置.为了使它更通用,可以将ylabel与常用的 set label 命令放在一起,使其独立于边距设置而固定:

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

这篇关于防止tic标签调整gnuplot中图形的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆