I want to create four 3D plots from a data set of 14 data arrays (i.e. the first two columns contain the X and Y data that I want to plot four of the other columns against). The arrays are output in 14 rows, instead of e.g. tab-separated columns, that in Igor I am loading into a matrix directly. From that point on I use the 'matrixtranspose' command on the matrix wave, turning the rows into columns and subsequently I copy and paste my columns of interest from the matrix into previously created waves. Those waves I 'concatenate', then 'interpolateimage' and I make an image plot from the resulting 3-wave matrix.
This process is a. crude/time consuming, b. difficult to turn into a procedure.
My question is: What command can I use to make a 1D wave from a matrix column, without manually using ctrl-C&ctrl-V (yes, I'm on a PC)?
Alternatively: What commands should I use to make 3D plots directly from the matrix, without breaking it up into waves?
Function ThreeColFromMatrix(m, zcolumn, outname)
Wave m
Variable zcolumn
String outname
Make/N=(DimSize(m, 0), 3)/Y=(wavetype(m)) $outname/WAVE=outw
outw[][0,1] = m[p][q]
outw[][2] = m[p][zcolumn]
end
No sanity checking (like making sure m really has enough columns or that zcolumn is >= 2), but it works...
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
August 16, 2011 at 10:47 am - Permalink