The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 How do I make odd shaped contour plots?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
prime Posted - 09/08/2000 : 5:58:00 PM
The Origin web page shows several sample contour plots that do not fill up the whole (rectangular) plot area:
http://www.originlab.com/www/graph_gallery/subjectindextemplate.asp?TypeID=Contour

I have XYZ data that I would like to plot like this. My data covers an odd-shaped central region and I would like to white out the outside area. What's the best way?

1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 09/14/2000 : 1:14:00 PM
You can use a new feature of 6.0 to mask out any shaped region you like. Drawing on some high school trigonometry I was able to come up with the following LabTalkTM script that works on an existing Contour Plot:

%M=%H;
win -a m248x248;
matrix -pg DIM ncol nrow;
matrix -pg X XMin XMax;
matrix -pg Y YMin YMax;
win -a %M;
win -t data origin;
%N=%H;
// Do the math for an Ellipse
a=(XMax-XMin)/2;
b=(YMax-YMin)/2;
px0=XMin+a;
py0=YMin+b;
stepsize=int(sqrt(ncol^2+nrow^2));
for(px=XMin,row=1;px<=XMax;px+=((XMax-XMin)/stepsize),row+=1) {
py=sqrt(b^2*(a^2-(px-px0)^2)/a^2)+py0;
%H_A[row]=px;
%H_B[row]=py;
};
row--;
for(px=XMax;px>=XMin;px-=((XMax-XMin)/stepsize),row+=1) {
py=-sqrt(b^2*(a^2-(px-px0)^2)/a^2)+py0;
%H_A[row]=px;
%H_B[row]=py;
}
// and add the data to the contour
win -a %M;
layer -i %N_B;
label -r legend;

(Warning! no checks are performed to verify that you have a contour plot as the active window. Also, if the contour contains other datasets, you must substitute the matrix name for %C.)

Once the script completes, you should open Plot Details for the added dataset and check the Fill Area Under Curve box and select Exclusive broken by missing values from the drop-down list. Then select the Pattern Tab and set the Fill Color to White (or whatever).


You can change the math to create any region you like or just use the Draw Data tool to create any arbitrary shape.


Users of previous versions must create four datasets which are grouped in pairs (top mask and bottom mask) and set with fill color and drop lines.


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000