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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Categorical variables in 3D plots
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

muratet

USA
1 Posts

Posted - 12/06/2002 :  12:39:49 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'm trying to figure out a way to make a 3D plot in which the X axis is categorical (Y axis is real, Z axis is real). The available gridding algorithms don't seem to handle this case. Does anyone have a workaround, or have I missed something?

Cheers

Mike

easwar

USA
1964 Posts

Posted - 12/06/2002 :  4:05:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

If you set your X column as categorical (highlight X, go to Column menu and make sure Set as Categorical - last item in that menu - is checked), then you can make XYZ Scatter and Trajectory plots.

But you cannot take the XYZ data where X is categorical, and then convert it into a matrix because the conversion expects all numerical values.

Now, Origin internally assigns values starting from 1, for all the items in the categorical column, by first sorting the column internally and finding out how many groups there are and just assigning values from 1 in acending order.

There is access to these values from script or Origin C.
For example, if you have data1_A to be set as categorical, then just create a new column, say data1_D, and then type the following in the script window:

loop(ii,1,N);
{
data1_d[ii] = data1_a[ii];
}
where N should be replaced with length of data1_a

This will get you the numeric values associated with the categories. You can then use these numeric values in conversion etc.

Hope this helps.

Easwar
OriginLab.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000