gnuplot pm3d未绘制所有数据 [英] Gnuplot pm3d not plotting all data

查看:57
本文介绍了gnuplot pm3d未绘制所有数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本文件,如下所示:

0 0 1
0 1 -1

1 0 -1
1 1 1

我正在绘制此with pm3d,并且调色板中的颜色数量设置为两种.我期望在对角有四个正方形,两个白色和两个黑色.但是,当我绘制此图形时,我只得到一个黑色的正方形,其尺寸为1乘1.最初,我使用的是更大的网格,而gnuplot似乎总是在绘制比我想要的少的行和列.怎么了?

解决方案

pm3d选项是对您定义的点之间的z值求平均值,这是标准的,我不确定如果不格式化您的z值就可以更改它数据.您可以做的是取消设置pm3d选项并使用with image样式进行绘制.实际上,我认为这是更可取的,因为所产生的数字的大小要小得多(按字节计).

使用您的数据集:

plot "data" with image

满足您的需求:

I have a text file that looks like this:

0 0 1
0 1 -1

1 0 -1
1 1 1

I'm plotting this with pm3d with the number of colours in the palette set to two. What I'm expecting is four squares, two white and two black, in opposite corners. However, when I plot this, I just get one black square measuring 1 by 1. I was initially working with much larger grids, and gnuplot seemed always to be plotting one less row and column than I wanted. What's going wrong?

解决方案

The pm3d option is averaging your z value between the points that you have defined, this is standard and I am not sure it can be changed without formatting your data. What you can do is to unset the pm3d option and plot with the with image style. I actually find this preferable because the figures produced are of much smaller size (byte-wise speaking).

With your set of data:

plot "data" with image

Yields what you want:

这篇关于gnuplot pm3d未绘制所有数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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