T O P I C R E V I E W |
cgreisen |
Posted - 07/15/2004 : 06:00:55 AM Hi there,
I have a bunch of data in columns schematically as follows
SampleID X Y A 1 2 B 1 0 B 3 4 C 0 2 A 2 3 C 1 4
Now I want Origin to recognize that this is 3 different data series (A,B,C) that should be plotted as 3 different line+scatter into the same graph. How can I do that ?
Regards,
Christoffer Greisen
|
2 L A T E S T R E P L I E S (Newest First) |
sammi.song |
Posted - 07/16/2004 : 03:36:10 AM Hi Christoffer,
There is another way to do this work if I did not make any misunderstanding.
1.Select View: Toolbarsˇ menu to open the Customize Toolbar dialog box. On Toolbar tab, check the ˇ°Columnˇ± checkbox to display the Column Toolbar in workspace. Close this dialog. 2.Right click on the SampleID Column to Set this column As Y, and click ˇ°Move to Lastˇ±button on Column Toolbar. Then please arrange your data columns as follow: X[X] Y[Y] SampleID[Y] 1 2 A 1 0 B 3 4 B 0 2 C 2 3 A 1 4 C 3.Highlight the first two columns---X[X] and Y[Y], in the worksheet and plot a Line + Symbol graph. 4.Select Format: Plotsˇ menu to open the Plot Details dialog. Now, the active tab is Symbol. 5.Change the Symbol size to 18. Check the ˇ°Show Constructionˇ± checkbox and choose col(SampleID) from the ˇ°Shapeˇ± drop-down list. Click OK to close Plot Details. 6.Right-click on the default legend, and choose Properties to bring up the Text Control dialog box. Place the following text in the edit box and click OK. \l(1,0) A \l(1,2) B \l(1,4) C
BTW, there is a Categorical Data.opj under our Samples\Graphing\2D Plots\ folder FYI. Hope they are useful.
Thanks, Sammi
Edited by - sammi.song on 07/16/2004 03:45:14 AM |
Mike |
Posted - 07/15/2004 : 11:01:02 AM Hi Christoffer:
If I understand correctly, you want all XY pairs of Sample ID A to plot as a line + symbol plot, all XY pairs of Sample ID B to plot as a second line + symbol plot, and all XY pairs of Sample ID C to plot as a third line + symbol plot (all plots in the same graph).
Since Origin 7, Origin has had limited categorical data support, but given your requirements and the way that your data are arranged, I wouldn't bother with this feature. I would do this:
- With your worksheet active, select Analysis:Extract Worksheet Data. In the if text box, enter this relationship:
col(A)[i]$=="A"
- Click Do it.
--> The worksheet data having the letter "A" in rows 1 to n, are extracted to worksheet DataN.
- Repeat steps 1 and 2 for Sample ID = B and C, substituting "B" and "C" for "A" in the above relationship. You'll now have three worksheets of XY pairs -- one for Sample ID = A, one for Sample ID = B and one for Sample ID = C.
- Highlight the X and Y columns in the worksheet that contains the "A" data and click the line + symbol button (make sure that these two columns are designated as X and Y).
- Right click on the layer icon in the upper-left corner of the graph. If you are using Origin 7 or earlier, select Add/Remove Plot from the shortcut menu. If you are using Origin 7.5, select Layer Contents from the shortcut menu.
- Add your "B" and "C" data -- probably identified as worksheetName_c -- into the Layer Contents(again, make sure that your X and Y data are designated as such).
- SHIFT+Select all data sets in Layer Contents and click Group, then OK.
- Click the Rescale button on the Graph toolbar.
--> All 3 plots are displayed as line+symbol plots in a single graph window.
- Click the New Legend button on the Graph toolbar.
--> All 3 data sets should now show in the legend.
You could do this more elegantly with a script, but I think this will give you what you want.
Mike OriginLab
Edited by - Mike on 07/15/2004 11:01:27 AM
Edited by - Mike on 07/15/2004 11:03:12 AM |
|
|