Gnuplot pm3d not plotting all data

对着背影说爱祢 提交于 2019-12-20 03:19:09

问题


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?


回答1:


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:



来源:https://stackoverflow.com/questions/22790143/gnuplot-pm3d-not-plotting-all-data

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