The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

425514 (7) [Avatar] Offline
With splot, I can generate a 2d contour plot from a "nonuniform matrix" data file. But I can only do it "with lines".
splot 'data.dat' nonuniform matrix with lines

If I try to add contour labels, I get this error message:
splot 'data.dat' nonuniform matrix with lines, 'data.dat' nonuniform matrix with labels
Plot style does not conform to three column data in this graph mode

It seems like if it can plot the lines, it ought to be able to label them, too. Am I missing something?
philipp.janert (286) [Avatar] Offline
I think the error message is misleading. The "with labels" style is not available with splot at all, for all I know.
425514 (7) [Avatar] Offline
Thanks for the reply, Phillip.
The demo file contours.dem uses splot to draw contours with lines and labels.
It does this for functions..
I'm trying to do the same thing for a nonuniform matrix, and I get that error message.

If I put my z data in a data file by itself, I can get the contour plot with lines and labels.
Section C.4 of your book showed me how to do this.
But this approach evidently can only be used with a uniform grid.

My data matrix has 12 x values and 180 y values.
x happens to be uniform, but y is not.
If I put the x data in the first block of the file,
and y in second block (two blank lines between x and y)
Then put the z matrix in a third block.
Can the index and using features specify these to the splot command?

425514 (7) [Avatar] Offline
philipp.janert (286) [Avatar] Offline
I am glad that you were able to figure it out.

Thanks for providing the link.