3D plot problem
GML
I apologize in advance if this topic is covered elsewhere, but after much searching I can't find the answer to my problem:
I have a data table with an irregular matrix of 1000 rows containing X Y Z data (that represent geographic coordinates: latitude, longitude and depth) and a fourth column with a value (concentration of an element) at that X Y Z point. I would like to create two types of 3D plots: 1) where each (XYZ) point is colored by its concentration and 2) a color-contoured version of (1) that I can then slice.
I am able to get gizmo to plot the X Y Z data by converting the data to an XYZ triplet then using new 3D plot > scatter plot. But in the dialog that appears, the option for 'color wave' gives no option. Is this where I should provide the 'value' for each XYZ point, or is there another/better way to produce such a plot?
Thanks in advance.
Scatter plot is one optional representation. You should also consider using ImageInterpolate Voronoi to create a proper surface out of the data. You can find an example of the whole procedure in a video tutorial "Creating a Surface Plot from Scatter Data (http://www.wavemetrics.com/products/igorpro/videotutorials.htm).
If you are using the scatter object and you would like to color the surface using an external wave you may execute the command:
The relevant documetation says:
creates a 4 column color wave with a row entry corresponding to each row in srcWave. Each row contains RGBA color taken from built-in ctabName and scaled according to the size of the row's z-value. The alpha values is set to 1 except when the z-value is a NaN (in which case alpha is set to zero). Note that this keyword also works when srcWave is a 1D wave.
If you create a full surface using the Voronoi interpolation (save the image in the wave dImage) you should follow the original surface triangulation with:
1. Create a new triplet wave with X&Y the same as before but replace the z-column with your original "fourth column". Now repeat ImageInterpolate using the same /S parameters. The new image is a sampling on a rectangular grid of your concentration parameter.
2. Select a color table, e.g., Rainbow.
3. Execute:
Wave M_colors
Variable N= DimSize(M_colors,0) // different size color tables
M_colors/=65535 // colors in Gizmo are [0,1]
4. Create the color wave at the same resolution (say rows x cols) as your concentration image say "cImage".
5. Find the min and max of cImage:
Variable mn=WaveMin(cImage)
Variable nor=(N-1)/(mx-mn)
6. Loop over cImage and map the colors:
for(i=0;i<rows;i+=1)
for(j=0;j<cols;j+=1)
index=nor*(cImage[i][j]-mn)
myColorWave[i][j][0]=M_Colors[index][0]
myColorWave[i][j][1]=M_Colors[index][1]
myColorWave[i][j][2]=M_Colors[index][2]
endfor
endfor
7. Now add to Gizmo a surface object for the wave dImage.
8. Set the color for the object to be myColorWave.
9. You can "slice" the result cImage along any path using ImageLineProfile.
I hope this helps,
A.G.
WaveMetrics, Inc.
September 25, 2014 at 04:26 pm - Permalink