turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Plotting Multiple Data Series Using Graph Builder

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 22, 2016 1:56 PM
(5154 views)

Hi all,

I have a feel this isn't possible, but I thought I would ask anyway. I would like to add different XY data sets to a graph. The problem is that series aren't sharing the same x values. What I am trying to do is plot swept data for many transistors and not all of the data has the same number of steps in the sweep.

If Column 1 and Column 2 are my first X and Y values, respectively, and Column 3 and 4 are my second set of X and Y values, respectively. When I add them to the Graph Builder, instead of getting two plots, I get four. Column 2 with Column 1, Column 2 with Column 3, Column 4 with Column 1 and Column 4 with Column 3. I see I have I can remove those from the plot by changing the transparency. However, I will be doing with with a lot of data and it wouldn't be practical at all to do it manually. Is there a way to do this with JSL?

Thanks, Natalie

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 25, 2016 4:05 PM
(8846 views)

Solution

Actually, as Jim mentioned, this is exactly the stack that's being performed.

```
Data Table( "Table" ) << Stack(
columns( :X1, :Y1, :X2, :Y2 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Number of Series( 2 )
);
```

As for the Graph Builder, rearranging the parameters produces this:

```
Graph Builder(
Show Control Panel( 0 ),
Variables( X( :Data ), Y( :Data 2 ), Overlay( :Label 2 ) ),
Elements( Points( X, Y), Smoother( X, Y ) )
);
```

Of course you would have to relabel the "Data" (X1&X2) and "Data2" (Y1&Y2) columns accordingly..

PDB

5 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 22, 2016 2:17 PM
(5013 views)

If I'm understanding you correctly, I think if you can stack the data and introduce a grouping variable then you can use that variable as GROUP X in Graph Builder.

Does this look like what you'd want? I can provide more details on the stacking if this is the right direction.

PDB

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 25, 2016 2:20 PM
(5013 views)

Hi Philip,

Thanks for getting back to me! That isn't quite what I had in mind, though. I took a screenshot of what I am looking for. This is an example using two sets of data but actually there will be over 100. Is there an easy way to do this for large sample sizes without manually changing the transparency of the curves?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 25, 2016 2:56 PM
(5013 views)

Natalie,

I think the solution is to stack your data, as Philip suggested, but you need to do a 2 column stack, where you stack all of your Y columns and all of your X columns. Then you can run the Graph Builder, and specify the "Label" column that is created in the stacking process, as the Overlay column in the Graph Builder. It will give you a separate line/curve for each level of "Label"(pair of X and Ys).

Jim

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 25, 2016 4:05 PM
(8847 views)

Actually, as Jim mentioned, this is exactly the stack that's being performed.

```
Data Table( "Table" ) << Stack(
columns( :X1, :Y1, :X2, :Y2 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Number of Series( 2 )
);
```

As for the Graph Builder, rearranging the parameters produces this:

```
Graph Builder(
Show Control Panel( 0 ),
Variables( X( :Data ), Y( :Data 2 ), Overlay( :Label 2 ) ),
Elements( Points( X, Y), Smoother( X, Y ) )
);
```

Of course you would have to relabel the "Data" (X1&X2) and "Data2" (Y1&Y2) columns accordingly..

PDB

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 25, 2016 8:08 PM
(5013 views)

Here's a further example with more series.

In general, the stack becomes:

```
Data Table( "StackedTable" ) << Stack(
columns(
:age, // X1
:ratio, // Y1
:age 1, // X2
:Predicted ratio, // Y2
:age 2, // X3
:Predicted ratio 2, // Y3
:age 3, // X4
:Predicted ratio 3, // Y4
:age 4, // X5
:Spline Predictor for ratio // Y5
),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Number of Series( 2 )
)
```

PDB