Thanks, this is very helpful.
I see now that "matrix" makes sense with "plot",
but only with style "image". Is this correct? Are
there legitimate uses for "matrix" with "plot", when
using different styles?
Also, can you give me a pointer to the manual
section you were referring to at the very end of
your email? I can't seem to find it.
On Sunday 22 November 2009 02:43:59 am you wrote:
> Philipp K. Janert wrote:
> > [snip]
> >> The end result I was aiming for when last I looked at this was
> >> to generate heatmaps directly from a csv file (e.g. from excel),
> >> where the row and column categories had headers. I'll draw this
> >> here as in-line data with whitespace. The command below doesn't
> >> work, of course, but I was trying to understand the whole matrix
> >> mechanism well enough to see if I could tweak things to make it work:
> >> plot "-" matrix using xticlabels(0):yticlabels(0) with image
> >> xx A B C
> >> X 0 2 1
> >> Y 2 0 1
> >> Z 1 1 2
> >> I forget now why I wanted it to be a 'plot' command rather than 'splot'.
> >> Maybe because of the limited control over tic label placement in 3D.
> >> Or maybe because the code at first looked slightly less confusing.
> > That seems to go back to my point - this kind of graph
> > is exactly what I always thought the splot command
> > specfically was for.
> I don't quite agree here.
> Plotting an image in a x/y grid is still a 2D plot.
> Hence it makes sense (to me at least) to use "plot" rather than "splot".
> You can do a pm3d map plot and use "splot" to get a seemlingly
> equal result, but this is
> 1) orders of magnitude less efficient, since splot with pm2d
> draws every single polygon, whereas "plot with image" simply
> creates an image map (try this with a 500x500 image)
> 2) it's not the same result since pm3d calculates the
> height as mean/min/max/etc of the 4 corner heights.
> Compare the output of
> plot "-" matrix with image
> 1 0 0
> 0 1 0
> 0 0 1
> set pm3d map
> splot "-" matrix with pm3d
> 1 0 0
> 0 1 0
> 0 0 1
> > So, if anything, I would think it makes sense to beef up
> > splot (ticmarks, whatever), rather than overload plot
> > with redundant functionality. (?)
> It's not redundant, in my opinion.
> Take a look at the gnuplot manual in section plotting style/image.
> It comments on the difference of "plot with image" and "splot with pm3d".