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
- :
- Re: How to generate multiple plots

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

Highlighted
##

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

How to generate multiple plots

Oct 24, 2019 4:29 PM
(1308 views)

I wrote a JMP script where I plot data based on my original data. After I manipulate data, I plot it again, but now it can only show the plot for data after manipulation, not the plot for original data. I would like to compare two. Could anyone help with this? Below is the script I used to plot the data.

```
Graph Builder(
Size( 748, 531 ),
Show Control Panel( 0 ),
Automatic Recalc( 0 ),
Variables( X( :X_NOM_BIN ), Y( :Y_NOM_BIN ), Color( :Name( "Mean(UPDATED THICKNESS" ) ) ),
Elements( Points( X, Y, Legend( 6 ) ) )
);
```

10 REPLIES 10

Highlighted
##

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

Re: How to generate multiple plots

I am not sure if you manipulate the data in the X role, the Y role, or both roles. You could save the manipulated data in a new column. You could also stack the original and manipulated data into one column and automatically create a label column to indicate which data is before and which data is after the manipulation.

Learn it once, use it forever!

Highlighted
##

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

Re: How to generate multiple plots

Here is a more detailed description of my problem

For example, if I have a data table below (dt):

A B

1 2

2 4

3 6

4 8

And I manipulate data to make another table (dtNew)

A B

1 4

2 8

3 10

4 12

Now I want to plot this two on separate plots. How can I do that?

Highlighted
##

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

Re: How to generate multiple plots

I see. Select Tables > Join. Change the Match option to Row Number. Now you have both data sets in the same table.

Learn it once, use it forever!

Highlighted
##

Thanks. But how to use JMP script to address this? I am creating a script that can do everything by just one click

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

Re: How to generate multiple plots

Highlighted
##

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

Re: How to generate multiple plots

Here is a very simple example on one way to do this:

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << select where( :SEX == "F" );
dt2 = dt << subset( selected rows( 1 ), selected columns( 0 ) );
dt << bivariate( x( :Height ), y( :weight ) );
dt2 << bivariate( x( :Height ), y( :weight ) );
```

or

```
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/big class.jmp" );
data table("big class") << select where( :SEX == "F" );
data table("big class") << subset( selected rows( 1 ), selected columns( 0 ) );
data table("big class") << bivariate( x( :Height ), y( :weight ) );
data table("Subset of big class") << bivariate( x( :Height ), y( :weight ) );
```

Jim

Highlighted
##

Thanks. What if I have a third dimension to plot a heat map plot. What function should be used in plotting (rather than bivariate)?

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

Re: How to generate multiple plots

Highlighted
##

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

Re: How to generate multiple plots

You can use Graph Builder to generate a Heat Map, or you can use a Cell Map.

You should take a look at the documentation

Help==>Books==>Essential Graphing

Jim

Highlighted
##

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

Re: How to generate multiple plots

Here is what I have. It always generate the second plot, but not the first. Could you tell me why?

```
dtSum << Graph Builder(
Size( 748, 531 ),
Show Control Panel( 0 ),
Automatic Recalc( 0 ),
Variables( X( :X_NOM_BIN ), Y( :Y_NOM_BIN ), Color( :UPDATED THICKNESS 1 ) ),
Elements( Points( X, Y, Legend( 6 ) ) )
);
dtSum6 << Graph Builder(
Size( 748, 531 ),
Show Control Panel( 0 ),
Automatic Recalc( 0 ),
Variables( X( :X_NOM_BIN ), Y( :Y_NOM_BIN ), Color( :Name( "RESIDUAL1_Normalized" ) ) ),
Elements( Points( X, Y, Legend( 6 ) ) )
);
```

Highlighted
##

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

Re: How to generate multiple plots

What are the messages in the log?

What is the value of the variable DTSUM? If you put

show(DTSUM);

just before

dtSum << Graph Builder(

it will print to the log what the value is......it needs to have the value of

dtSum = Data Table( "your data table name" )

Jim