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: JSL: How to add graph to an existing window

- 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

Aug 8, 2019 10:25 AM
(2211 views)

Hi, I am using JSL to plot with graph builder.

Every graph usally created in a seperate window which opens too many window.

I want to put each graph into the same window then close the new created window.

Below are my draft jsl, can anyone help me to make it work?

Thank you.

```
WW1 = New Window( "graph1", Graph Builder() );
Window( "graph1" ) << Close Window();
WW2 = New Window( "graph2", Graph Builder() );
Window( "graph2" ) << Close Window();
WW3 = New Window( "graph3", Graph Builder() );
Window( "graph3" ) << Close Window();
```

2 ACCEPTED SOLUTIONS

Accepted Solutions

Highlighted

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

Take a look at this example. It creates one window with 20 graphs defined for it, with no additional graphs being created

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
nw = New Window( "graphs", myvlb = V List Box() );
colNamesList = dt << get column names( continuous, string );
For( i = 1, i <= 20, i++,
myvlb << append( oneway( x( :site ), y( Column( colNamesList[i] ) ) ) )
);
```

Jim

Highlighted

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

Thank you for the help.

I will try to put this with my scripts.

@txnelson wrote:Take a look at this example. It creates one window with 20 graphs defined for it, with no additional graphs being created

`Names Default To Here( 1 ); dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" ); nw = New Window( "graphs", myvlb = V List Box() ); colNamesList = dt << get column names( continuous, string ); For( i = 1, i <= 20, i++, myvlb << append( oneway( x( :site ), y( Column( colNamesList[i] ) ) ) ) );`

7 REPLIES 7

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

Re: JSL: How to add graph to an existing window

Here are two ways to have multiple outputs in one window. There are other ways too

```
names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");
nw=new window("Example 1",
bivariate(x(:height), y(:weight)),
oneway(x(:sex),y(:weight))
);
nw2=new window("Example 2");
nw2<<append(bivariate(x(:height), y(:weight)));
nw2<<append(oneway(x(:sex),y(:weight)));
```

Jim

Highlighted
##

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

Re: JSL: How to add graph to an existing window

The journal window might be a solution as well. Send the <<journal command to the windows before you close them. The journal window keeps a tall list of the entries.

Craige

Highlighted
##

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

Re: JSL: How to add graph to an existing window

I used journal before, but journal will freeze the graph, meaning I can not select the the data in the graph anymore, it is more like a picture.

Thank you.

@Craige_Hales wrote:The journal window might be a solution as well. Send the <<journal command to the windows before you close them. The journal window keeps a tall list of the entries.

Highlighted
##

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

Re: JSL: How to add graph to an existing window

Thanks for the solution, for some reason it doesn't work in my script.

Can you help to modify based on my script below?

I am ploting over 200 graph which can only be done with graph builder.

So I hope to add the graph to a same window graph, then close the graph builder window after ploting.

Otherwise, I end up open 200 windows.

```
WW1 = New Window( "graph1", Graph Builder() );
Window( "graph1" ) << Close Window();
WW2 = New Window( "graph2", Graph Builder() );
Window( "graph2" ) << Close Window();
WW3 = New Window( "graph3", Graph Builder() );
Window( "graph3" ) << Close Window();
```

@txnelson wrote:Here are two ways to have multiple outputs in one window. There are other ways too

`names default to here(1); dt=open("$SAMPLE_DATA/big class.jmp"); nw=new window("Example 1", bivariate(x(:height), y(:weight)), oneway(x(:sex),y(:weight)) ); nw2=new window("Example 2"); nw2<<append(bivariate(x(:height), y(:weight))); nw2<<append(oneway(x(:sex),y(:weight)));`

Highlighted

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

Take a look at this example. It creates one window with 20 graphs defined for it, with no additional graphs being created

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
nw = New Window( "graphs", myvlb = V List Box() );
colNamesList = dt << get column names( continuous, string );
For( i = 1, i <= 20, i++,
myvlb << append( oneway( x( :site ), y( Column( colNamesList[i] ) ) ) )
);
```

Jim

Highlighted

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

Thank you for the help.

I will try to put this with my scripts.

@txnelson wrote:`Names Default To Here( 1 ); dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" ); nw = New Window( "graphs", myvlb = V List Box() ); colNamesList = dt << get column names( continuous, string ); For( i = 1, i <= 20, i++, myvlb << append( oneway( x( :site ), y( Column( colNamesList[i] ) ) ) ) );`

Highlighted
##

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

Re: JSL: How to add graph to an existing window

Hi @Stokes ,

@txnelson and @Craige_Hales gave good examples. another way to do it is to start with just one window. if you have a data table open, try using this script. once you make the graphs you want in that window you can save the script from the plot.

```
New window ("lots of graphs",
v list box (
Graph Builder(),
Graph Builder(),
Graph Builder(),
Graph Builder(),
Graph Builder(),
Graph Builder(),
)
);
```