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
 Color Mapping with discrete values
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

CRTBT-UBT

France
Posts

Posted - 01/17/2006 :  12:18:58 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: Win-XP

Hi,
I would like to do a simple 2D XY-Scatter-Plot, color each symbol depending on a value stored in a third column and add the corresponding color scale to the plot. These values are discrete values (magnetic field values), so the built-in color-mapping only works with a tedious work-around as it is made for ranges and not for discrete values. Another tedious work around is to copy the data for each magnetic field in a seperate worksheet and then plot them together in one graph.
Is there a simple way I oversaw to do it? If yes how? Or are there some scripts/functions which might work?

Thanks for help, Johannes

greg

USA
1378 Posts

Posted - 01/17/2006 :  4:13:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There probably isn't a simple, satisfactory solution, but here is one possibility:

Your problem is that the Z levels are distributed linearly in 'Z' space whereas you want the Z levels to match your magnetic field values.

In the case where all magnetic field values are unique you can do that by running this script:
// BEGIN SCRIPT
temp=sort(data1_c);
get temp -e end;
layer.cmap.numcolors=end;
for(ii=1;ii<=end;ii++) {
layer.cmap.z$(ii)=temp[ii];
}
// END SCRIPT
Be sure to change the "data1_c" to match the name of the magnetic field values dataset.

If some of your magnetic field values repeat, you can still use the above script, but repeated values will have different colors and the colormap would not tell you which point is which. You could get around that by removing duplicates from the temp dataset and adjusting the 'end' value before executing the third line of the script ( which I leave as an exercise ).

Go to Top of Page

CRTBT-UBT

France
Posts

Posted - 01/18/2006 :  08:22:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, I will try this... and yes, I have for every field seveeral values, so the execrcise will be necessary :-)
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