I have successfully generated 3D and 2D plots from a large data file of pixel values, where the file is a list of xyz values in csv format with 3 columns: integer x value, integer y value, decimal z value. I would like to create a 2D histogram of only the z column now with, for example, 1000 bins from min to max value (or limits I hard code in). I don't know if this is possible as I could not find an adequate example in the demos or help text. Has someone done this already, and can you share a good example code? I don't know if I need to do this in two phases, first being to bin the values and next to plot them, or if this should be essentially a one-command operation. Thanks for any help.
I attached the first two rows of my xyz data which represents what I want to plot as a histogram.
See "help smooth frequency"
Hi Ethan, saw this in the help file when I jumped to the smooth.dem page:
plot "random-points" u 2:(0.25*rand(0)-.35) t '', \ "" u (bin($2,0.05)):(20/300.) smooth freq t 'smooth frequency' w boxes, \ "" u 2:(1/300.) smooth cumulative t 'smooth cumulative'
and this raises a whole mess of new questions, but some of the first are:
what do u and t do? Not mentioned in help files! using and title?
what is the $ doing?
I will play around with this and post again if I get stuck, seems like this is the solution for me though, I just need to select column 3 within my datafile and get the scaling and binning correct.
Thanks for the tip.
u and t are the dummy variables for a parametric function. They are not relevant to your case.
$2 is shorthand for column(2) , i.e. the value of the 2nd column in your data file
plot FOO using 1:2:3
is the same as
plot FOO using ($1):($2):($3)
is the same as
plot FOO using (column(1)):(column(2)):(column(3))