gnuplot:如何将绘图区域设置为数据的像素完美表示
我很难让 GNUplot 正确渲染我的一些数据。基本上我有一些 2D 高度图数据(例如 512 x 128 数据点),并且希望能够以“像素完美”方式绘制此数据(即每个数据点一个像素)。不幸的是,目前,由于像素数量略大于数据点数量,我得到了伪影(参见插图)。我知道我可以使用以下方法设置输出的总大小:
set terminal png size 800,400
但是有没有办法只设置绘图区域大小(以像素为单位)?
谢谢!
I'm having difficulty getting GNUplot to properly render some of my data. Basically I have some 2D heightmap data (for example 512 x 128 data points) and would like to be able to plot this in a "pixel perfect" fashion (i.e. one pixel per data point). Unfortunately at the moment, I'm getting artefacts (see inset) due to the number of pixels being slightly larger than the number of data points. I know I can set the total size of the output using:
set terminal png size 800,400
but is there a way to set just the plot area size in pixels?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 lua/TikZ 终端的帮助下(有一个选项plotsize),建议删除绘图边距,以便绘图填充整个画布。
然而,这有一个缺点,就是你不会有tic标签等等。您当然可以自己计算边距值,以便它们最终与绘图大小相匹配:
例如使用。
无论如何,我还建议尽可能使用矢量图形。
From the help of the lua/TikZ terminal (there is an option plotsize) it is suggested to remove the plot margins so that plot fills the whole canvas.
However, this has the drawbacks that you will not have tic labels and so on. You can of course calculate values for the margins yourself, so that they match with the plot size in the end: use
for example.
Anyway, I would also recommend going for vector graphics whenever possible.