Author |
Topic |
|
edgar.kaiser
Switzerland
29 Posts |
Posted - 12/11/2002 : 10:15:21 AM
|
Hi,
I have a matrix with missing values (cells contain --) and want to do a surface plot displaying holes where missing values are. Origin 7pro patch2 however assigns a value of zero to missing values. This results in a display of steep walls from the edge of cells containing valid data to the missing values which are displayed on a z=0 plane. How can I avoid that?
Thanks,
Edgar
easwar responded to a similar request on 11/19/2001 17:34:40, but the advice he gave does not work for me and the new Origin version! |
|
Hideo Fujii
USA
1582 Posts |
Posted - 12/12/2002 : 12:04:04 PM
|
How about this?:
1) Record the cell positions with missing-values in your matrix; 1) Patch every missing value in the matrix with an approproate value such as the average of surrounding cells. (Or, use gridding); 3) Replicate your matrix; 4) Place missing values in the replicated matrix where originally the cell was filled with a value. Then make a regular XYZ worksheet from this. 5) Make a surface plot from original matrix, and a 3D scatter plot from the worksheet. 6) Combine two graphs into a 1X1 2-layer graph. 7) Make the background colorless of the front layer, adjust the projection angles and scales of axes.
===== sample script to patch holes (You probably want to use OriginC if your matrix is large):
loop(numr,1,wks.nrows){ loop(numc,1,wks.ncols){ if(cell(numr,numc)!=(1/0)) {continue}; nn=0; tt=0; loop(rr,-1,1){ loop(cc,-1,1){ if(rr==0 && cc==0) {continue}; if((numr+rr)<0 || (numc+cc)<0) {continue}; if((numr+rr)>wks.nrows || (numc+cc)>wks.ncols) {continue}; if(cell(numr+rr,numc+cc)==(1/0)) {continue} else {nn++; tt=tt+cell(numr+rr,numc+cc)}; } } cell(numr,numc)=tt/nn; }; } ==============================
Edited by - Hideo Fujii on 12/12/2002 12:05:24 PM |
|
|
easwar
USA
1964 Posts |
Posted - 12/13/2002 : 1:50:33 PM
|
quote:
Origin 7pro patch2 however assigns a value of zero to missing values. This results in a display of steep walls from the edge of cells containing valid data to the missing values which are displayed on a z=0 plane. How can I avoid that?
Hi Edgar,
Currrently there is no way to avoid this. We are working on making the missing value cells show up to be transparent in image plots, in a future version (Image Plot is a new plot type in Ver 7).
My apologies if my post from a previous date was misleading.
Easwar OriginLab.
Edited by - easwar on 12/13/2002 1:51:31 PM |
|
|
|
Topic |
|
|
|