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
 Colors of Histogram Bars
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

SuperUke

Germany
Posts

Posted - 05/16/2008 :  09:28:57 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version 8G SR1:
Operating System: Windows NT

I have a set of Data consiting of batches of 4 measurements.

ID Value Error
A-1 10 0.1
A-2 11 0.3
A-3 9 0.2
A-4 10 0.1
B-1 8 0.2
B-2 7 0.3
..

Now i did a histogram plot of all these Data wit Errorbars and i want to have the bars of the batches (A-1 to A-4 and B1- to B-4...) in the same color. (A = Red, B = Green...)
Is that possible to to in one Layer?

Cheers

Sascha

greg

USA
1379 Posts

Posted - 05/16/2008 :  10:23:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Firstly, I am assuming by 'histogram plot .. with error bars' you mean you plotted your Value and Error data as a column plot with error bars.
(Origin has a Histogram plot which does statistical binning, but it handles neither grouping - A, B, etc - nor error data.)

If you add a fourth column to your worksheet and filled it with integer values such that the value is 2 when the ID is A.. and the value is 3 when the ID is B.. then you can do the following with your column plot:
Double-click on the plot to open Plot Details
On the Pattern tab, click the button next to 'Fill Color'
Select Indexing : Col(?) - where ? is the name of your added column
Click OK

The A.. bars will now be red and the B.. bars will now be green.

The numbers entered into the column correspond to the index numbers in Origin's standard color list : 1=Black, 2=Red, 3=Green, etc.

Given a worksheet with these columns and these plot designations:
ID(X), Value(Y), Error(yEr)
then this script accomplishes everything:
//BEGIN SCRIPT
wo -a 1;
get col(1) -e end;
loop(ii,1,end)
{
%A = col(1)[ii]$;
%A = %[%A,1:1]; // get first letter
switch(%A)
{
case "A":
col(4)[ii] = 2; // A=red
break;
case "B":
col(4)[ii] = 3; // B=green
break;
default:
col(4)[ii] = 1; // unknown=black
}
}
wo -s 2 0 3 0;
wo -p 203 column;
set %C -cf 103;
// END SCRIPT


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