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
 Stock coulumn plots with two grouped data sets

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
koshikaw@n Posted - 03/09/2003 : 04:41:53 AM
Can I create a stock column graph with two grouped data sets?

As an example, a simple data set is shown.

[X]*[A]*[B]*[C]*[D]
*1***3***2***2***2
*2***2***2***1***2
*3***2***1***3***2


Here, rows of "[A] & [B]" and "[C] & [D]" are grouped Y data, respectively.
I'd like to make two stack columns against each X value as below.
How can I do such a plot?

**|*B*************D
**|*B*D***B*******D
Y*|*A*D***B*D***B*C
**|*A*C***A*D***A*C
**|*A*C***A*C***A*C
**------------------
*****1*****2*****3
***********X


Thanks in advance


5   L A T E S T    R E P L I E S    (Newest First)
Laurie Posted - 03/12/2003 : 10:01:47 AM
The data arrangement that you used works quite well. I agree that it is a bit tricky. I've added your comments to our development database, so that our programmers can consider better support in the next version. Thank you.

OriginLab Technical Support
koshikaw@n Posted - 03/12/2003 : 02:40:30 AM
Thanks, Charles and Laurie.
I tried the suggested two methods and they works well!

From my this experience, I would like to add some info to Charles' way.
To apply Charles' mehtod, I think it's better to make data rearrangement as follows.


[X], [Y1], [Y2], [Y3], [Y4]
0.9,- 3.0, -2.0,-----,-----
1.1, ----,-----, -2.0, -2.0
1.9, -2.0, -2.0,-----,-----
2.1, ----,-----,--1.0, -2.0
2.9, -2.0, -1.0,-----,-----
3.1, ----,-----, -3.0, -2.0


By giving offsets of the equal size in the positive and negative, adjustment of the x-axis label position can be simplified.

p.s. these methods seem to be tricky. I expect that "grouping function" will be improved in the next version of Origin.


cjfraz Posted - 03/11/2003 : 12:09:46 PM
hmmm. I see your point Laurie, which I had not considered. Another possibility for making a stack column as you describe (instead of just a column with the sums) would be to simply rearrange the data in the original worksheet from how koshikaw presented it... i.e.

[x] , [y1] , [y2]
1 , 3 , 2
2.2 , 2 , 2
4 , 2 , 2
5.2 , 1 , 2
7 , 2 , 1
8.2 , 3 , 2


all of the x values of x.2 have the data that was previously in col(c) and col(d). With the data arranged this way you can just make a vanallia single layer stacked column graph and get the same result as with the two layer solution. If necessary it probably wouldn't be difficult to write a script to rearrange the data this way automatically.

J...


Edited by - cjfraz on 03/11/2003 12:47:44 PM
Laurie Posted - 03/11/2003 : 11:39:58 AM
The solution given above works but you won't get the individual group members for the stacking; you'll just see one solid color for each column.

You could create 2 stacked column graphs; one with A and B and the other with C and D. Then merge the two by selecting Edit:Merge all Graph Windows. Now reposition layer 2, turn off the axes and set the Spacing in Plot Details. This method takes a bit of manipulating, but you can set the graph up. You'll probably also want to turn off the X axis tick labels and then create your own by just adding text labels.



OriginLab Technical Support
cjfraz Posted - 03/11/2003 : 09:16:43 AM
There may be multiple solutions, but for this simple case my approach would be to add two new columns to the worksheet and then type the following commands into the script window:

col(e)=col(a)+col(b);
col(f)=col(c)+col(d);

Then make a column graph with E and F as Y datasets against your X dataset.

J...

ps- note that in a typical worksheet col(a) would be your X dataset and your next four columns would be B-E, so the above script would have to be adjusted to use the actual column names, e.g.
col(f)=col(b)+col(c);
col(g)=col(d)+col(e);


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