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
 Colors of Histogram Bars

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
SuperUke 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
1   L A T E S T    R E P L I E S    (Newest First)
greg 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



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