Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
skyzvoir0001
Level III

Powerpoint

Hi, I have this code which shows a window with multiple plots. Question is, how do i save the output in powerpoint as one slide?

 

 

New Window( "Para v PGT",
	Lineup Box( N Col( 3 ),
		For( i = 1, i <= N Items( colname ), i++,
			For( j = 1, j <= N Items( colnamex ), j++,
				biv = Bivariate( Y( Column( dt, colname[i] ) ), X( Column( dt, colnamex[j] ) ), group by( groupcol ) );

				rbiv = biv << report;

				rbiv[FrameBox( 1 )] << {Frame Size( 240, 190 ), Marker Size( 1 ), Line Width Scale( 3 )};

				rbiv[axis box( 2 )] << Tick Font( style( 1 ), size( 9 ) ) << Show Major Grid( 1 ) << Show Minor Grid( 1 ) << Show Minor Ticks( 1 );

				rbiv[axis box( 1 )] << Tick Font( style( 1 ), size( 9 ) ) << Show Major Grid( 1 ) << Show Minor Grid( 1 ) << Show Minor Ticks( 1 );

				rbiv[Text Edit Box( 2 )] << Set Font Size( 10 ) << Set Font Style( "Bold" );

				rbiv[Text Edit Box( 1 )] << Set Font Size( 10 ) << Set Font Style( "Bold" );
			)
		)
	)
);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: Powerpoint

Here is an example of how I handle this.  I simply move the objects into a single picture object, and then save the picture object.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/blood pressure.jmp" );
colname = {"BP 8M", "BP 12M", "BP 6M"};
colnamex = {"BP 8W", "BP 12W", "BP 6W"};
groupcol = Column( "Dose" );

ob = Outline Box( "",
	Lineup Box( N Col( 3 ),
		For( i = 1, i <= N Items( colname ), i++,
			For( j = 1, j <= N Items( colnamex ), j++,
				biv = Bivariate(
					Y( Column( dt, colname[i] ) ),
					X( Column( dt, colnamex[j] ) ),
					group by( groupcol )
				);
				rbiv = biv << report;
				rbiv[FrameBox( 1 )] << {Frame Size( 240, 190 ), Marker Size( 1 ), Line Width Scale( 3 )};
				rbiv[axis box( 2 )] << Tick Font( style( 1 ), size( 9 ) ) << Show Major Grid( 1 ) <<
				Show Minor Grid( 1 ) << Show Minor Ticks( 1 );
				rbiv[axis box( 1 )] << Tick Font( style( 1 ), size( 9 ) ) << Show Major Grid( 1 ) <<
				Show Minor Grid( 1 ) << Show Minor Ticks( 1 );
				rbiv[Text Edit Box( 2 )] << Set Font Size( 10 ) << Set Font Style( "Bold" );
				rbiv[Text Edit Box( 1 )] << Set Font Size( 10 ) << Set Font Style( "Bold" );
			)
		)
	)
);

nwj = New Window( "Para v PGT", <<journal );
nwj << append( ob << get picture );
nwj << save presentation( "$TEMP/jmp_example.pptx" );
Open( "$TEMP/jmp_example.pptx" );

ppt.PNG

Jim

View solution in original post

3 REPLIES 3
Highlighted
txnelson
Super User

Re: Powerpoint

Here is an example of how I handle this.  I simply move the objects into a single picture object, and then save the picture object.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/blood pressure.jmp" );
colname = {"BP 8M", "BP 12M", "BP 6M"};
colnamex = {"BP 8W", "BP 12W", "BP 6W"};
groupcol = Column( "Dose" );

ob = Outline Box( "",
	Lineup Box( N Col( 3 ),
		For( i = 1, i <= N Items( colname ), i++,
			For( j = 1, j <= N Items( colnamex ), j++,
				biv = Bivariate(
					Y( Column( dt, colname[i] ) ),
					X( Column( dt, colnamex[j] ) ),
					group by( groupcol )
				);
				rbiv = biv << report;
				rbiv[FrameBox( 1 )] << {Frame Size( 240, 190 ), Marker Size( 1 ), Line Width Scale( 3 )};
				rbiv[axis box( 2 )] << Tick Font( style( 1 ), size( 9 ) ) << Show Major Grid( 1 ) <<
				Show Minor Grid( 1 ) << Show Minor Ticks( 1 );
				rbiv[axis box( 1 )] << Tick Font( style( 1 ), size( 9 ) ) << Show Major Grid( 1 ) <<
				Show Minor Grid( 1 ) << Show Minor Ticks( 1 );
				rbiv[Text Edit Box( 2 )] << Set Font Size( 10 ) << Set Font Style( "Bold" );
				rbiv[Text Edit Box( 1 )] << Set Font Size( 10 ) << Set Font Style( "Bold" );
			)
		)
	)
);

nwj = New Window( "Para v PGT", <<journal );
nwj << append( ob << get picture );
nwj << save presentation( "$TEMP/jmp_example.pptx" );
Open( "$TEMP/jmp_example.pptx" );

ppt.PNG

Jim

View solution in original post

Highlighted
skyzvoir0001
Level III

Re: Powerpoint

Hi thanks for the reply! Is there a way to make them output like plot per slide and put a slide title?

Highlighted
txnelson
Super User

Re: Powerpoint

The Save Presentation() function, will take the verbage from an Outline Box() as the title for the graph.  So, if you change the last few lines of the previous example I provided, to the following, you will get the title you want

titleOB = outline box("Here is the Title");
titleOB << append(ob<< get picture);

titleOB << save presentation( "$TEMP/jmp_example.pptx" );
Open( "$TEMP/jmp_example.pptx" );
Jim
Article Labels

    There are no labels assigned to this post.