Author |
Topic |
|
kloostep
Netherlands
2 Posts |
Posted - 02/01/2017 : 07:43:47 AM
|
Hi there,
I’m trying to plot individual lines per person through multiple x,y points per person over time. In this case x- and y-values are both cumulative scores at the same time point. So all first measurements start at 0,0 for x,y. The number of x,y points available varies per person.
Using the workbook setup depicted here: http://imgur.com/a/iB3LU (Imgur link because image upload of the forum is offline) and selecting a simple Line + Symbol graph I pretty much end up with the graph I intended, with one exception: For some reason Origin also draws a line from the first intersection to the third intersection (e.g., to x,y=120,80 for the person ID=1) or another (random?) follow-up intersection (e.g., to x,y 1500,100 for person ID=4).
I need a graph with only the lines drawn between subsequent x,y intersections per person, but can’t seem to manage this. Anyone know how to do this?
PtK |
|
cpyang
USA
1406 Posts |
Posted - 02/01/2017 : 11:29:45 AM
|
Simplest solution is to insert a row between each person and fill missing values. Line symbol plot will break at missing values.
CP
|
|
|
snowli
USA
1385 Posts |
Posted - 02/01/2017 : 3:53:22 PM
|
Origin has an x-function to plot data based on grouping informration http://www.originlab.com/doc/X-Function/ref/plotgroup into multiple graph/layer or different data.
Highlight your B and C columns. Then choose Window: Script Window. Run plotgroup -d to open the dialog
In the dialog, click the > next to Column for Data Group and pick the grouping column A.
Make sure input is your B(X) and C(Y).
Plot type: Line+Symbol.
It will plot each group like an individual plot. Even plot color is based on grouping infor. You can open PD. On Group tab, set Line color Incrment to None so they are all black.
Thanks, Snow |
|
|
kloostep
Netherlands
2 Posts |
Posted - 02/02/2017 : 12:19:20 PM
|
Thank you very much for the quick help cpyang and snowli!
Both solutions (inserting an empty row between each person and the plotgroup function) work perfectly. Especially the latter solution is elegant and requires less data prepararation.
Problem solved!
PtK |
|
|
|
Topic |
|
|
|