Author |
Topic  |
|
SuperUke
Germany
Posts |
Posted - 05/16/2008 : 09:28:57 AM
|
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
|
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
|
 |
|
|
Topic  |
|
|
|