Make matrix from wave and display as contour plot.

I try to convert a txt file with 4 colums to a matrix to display a conture plot. The structure is like x y a z. (a is not neeed at the moment.)

The problem is that the first colum is a x colum with 1340 row with the same value and corresponding y and z values changes.


example:

8900.00 7346.18 1553.82 5.9936e-04
8900.00 7346.21 1553.79 7.4345e-04
8900.00 7346.25 1553.75 2.0004e-04
8900.00 7346.28 1553.72 2.1976e-04
8900.00 7346.31 1553.69 1.4326e-03
8900.00 7346.35 1553.65 8.4940e-04
8900.00 7346.38 1553.62 2.7174e-04
8900.00 7346.41 1553.59 1.4487e-03

...........

8905.00 7351.18 1553.82 8.7347e-04
8905.00 7351.21 1553.79 1.8951e-03
8905.00 7351.25 1553.75 -2.1903e-04
8905.00 7351.28 1553.72 2.3094e-04
8905.00 7351.31 1553.69 4.6115e-04
8905.00 7351.35 1553.65 2.0042e-03
8905.00 7351.38 1553.62 2.6526e-03
8905.00 7351.41 1553.59 1.0029e-03
...........

and so on.

Any ideas, thanks in advance.

The x,y coordinates do not appear to be linearly spaced in your example, but that may also be due to rounding occurring somewhere along the line. If you're sure that they're linearly spaced, and can preferably get a higher precision, then take a look at http://www.igorexchange.com/node/2491 for tips on how to convert it to a matrix.

But if all you want is a contour plot then there's no need to make a matrix. Just select x,y,z waves as the type of data in the dialog.
Superior-Custom wrote:
I try to convert a txt file with 4 colums to a matrix to display a conture plot. The structure is like x y a z. (a is not neeed at the moment.)

1. Load the data as 4 different waves, you can rename them to xx, yy, aa, zz
2. select from the menu: Window:New:Contour plot...;
3. In the pop-up window, use the data format as X, Y, and Z waves and select your data waves
4. Use the option "Appearance..." to customize the contour image.

Superior-Custom wrote:
The problem is that the first colum is a x colum with 1340 row with the same value and corresponding y and z values changes.

The Igor Pro will do some math and show the lines of constant zz value. It is O.K. to have identical x values.

Yaohua Liu

Try the XYGridandZtoMatrix() macro in
#include <XYZToMatrix>


If your data is sufficiently close to a grid, that'll nicely create a regular matrix from your xyz data.

But 741 and yaohualiu are right: Igor will make an XYZ contour from either an xyz triplet wave or separate x, y, and z waves.


--Jim Prouty
Software Engineer, WaveMetrics, Inc.
Dear Superior-custom (if we recall correctly), I inadvertantly deleted your account when deleting a bunch of similarly-named spam accounts. Sorry! Feel free to sign up again.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.