views:

623

answers:

2

Hello, I have a pairs of the points with their weights:

#x  y  w
0.111342 0.478917 0.232487 
0.398107 1.79559 0.221714 
0.200731 2.58651 0.0776068 
0.0967412 1.49904 0.0645355 
6.17638 8.63101 0.715604 
0.306128 3.10917 0.0984595 
0.340707 3.19344 0.10669 
7.18627 8.59859 0.835751 
8.56 9.63894 0.888065 
5.14272 6.86074 0.749587 
0.747202 3.812 0.196013 
8.71891 10.1355 0.860232 
0.346714 1.45895 0.237647 
5.21932 8.84491 0.590094 
9.42138 12.2082 0.771725 
0.215627 2.42317 0.0889856 

How to plot nice 2d histogram image with color bar? I found nice density map description but I don't wont to go via python. I there way to use only gnuplot scripting?

Kind Regards Arman.

+1  A: 

I think gnuplot pm3d graphs are cute.

zoli2k
@shakov: thanks for replay. The pm3d works if you have already 2d image or 2d histogram. My question is how to generate that data, then I can plot it with pm3d.
Arman
Gnuplot is a graphing utility. My personal opinion that you should do generate/parse the data outside of Gnuplot in Octave/Python/Awk.
zoli2k
A: 

It's best to use an external histogramming tool, but you can achieve something similar in gnuplot via:

set pm3d at b      # draw on bottom, not as 3d surface
set view map       # don't do a 3-d looking plot
set dgrid 100,100  # grid of 100x100 pixels
splot 'dat.txt' w pm3d
kosack
I should note that this doesn't allow you to use the weights (it just bins the first two columns). For that, you need to use an external histogram tool: I suggest python's numpy "histogram2d" function, or gsl's gsl_histogram2d functions
kosack