cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Françoise
Level V

Image in a dashboard

Hi,

I've insert an image in a dashboard with this script:

img = Open(
"S:\xxxxxx.jpg",
"jpg"
);

Graph Box(
FrameSize( 1400, 880 ),
X Scale( 0, 410 ),
Y Scale( 0, 100 ),
<<Add Image( image( img ), bounds( top( 90 ), Left( 10 ), bottom( 10 ), Right( 400 ) ) )
);

 

How to do to avoid the numbers for the 2 axes or to avoid the axes?

 

thanks

 

best regardsCapture.JPG

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Image in a dashboard

You do not need a picture box (returned from calling Graph Box() function) to display an image. You can place it anywhere in the display tree that you are building.

Names Default To Here( 1 );
image = New Image( "$SAMPLE_IMAGES/windmap.png" );
New Window( "new image", image );

View solution in original post

Jeff_Perkinson
Community Manager Community Manager

Re: Image in a dashboard

@Mark_Bailey is right. You don't need the Graph Box(). If you do want to use it you can control the axis by sending messages to the Axis boxes in the Graph Box.

 

img = Open( "$SAMPLE_IMAGES/windmap.png", "png" );

gb = Graph Box(
	FrameSize( 1400, 880 ),
	X Scale( 0, 501 ),
	Y Scale( 0, 429 ),
	<<Add Image( image( img ), bounds( top( 429 ), Left( 0 ), bottom( 0 ), Right( 501 ) ) )
);
gb[axisbox( 1 )] << show major labels( 0 );
gb[axisbox( 1 )] << show major ticks( 0 );
gb[axisbox( 1 )] << labels( 0 );
gb[axisbox( 2 )] << show major labels( 0 ); gb[axisbox( 2 )] << show major ticks( 0 ); gb[axisbox( 2 )] << labels( 0 ); New Window( "my window", gb );

2022-12-13_10-37-44.607.png

-Jeff

View solution in original post

4 REPLIES 4

Re: Image in a dashboard

You do not need a picture box (returned from calling Graph Box() function) to display an image. You can place it anywhere in the display tree that you are building.

Names Default To Here( 1 );
image = New Image( "$SAMPLE_IMAGES/windmap.png" );
New Window( "new image", image );
Françoise
Level V

Re: Image in a dashboard

Hello,

 

thanks !

 

all the best !

Jeff_Perkinson
Community Manager Community Manager

Re: Image in a dashboard

@Mark_Bailey is right. You don't need the Graph Box(). If you do want to use it you can control the axis by sending messages to the Axis boxes in the Graph Box.

 

img = Open( "$SAMPLE_IMAGES/windmap.png", "png" );

gb = Graph Box(
	FrameSize( 1400, 880 ),
	X Scale( 0, 501 ),
	Y Scale( 0, 429 ),
	<<Add Image( image( img ), bounds( top( 429 ), Left( 0 ), bottom( 0 ), Right( 501 ) ) )
);
gb[axisbox( 1 )] << show major labels( 0 );
gb[axisbox( 1 )] << show major ticks( 0 );
gb[axisbox( 1 )] << labels( 0 );
gb[axisbox( 2 )] << show major labels( 0 ); gb[axisbox( 2 )] << show major ticks( 0 ); gb[axisbox( 2 )] << labels( 0 ); New Window( "my window", gb );

2022-12-13_10-37-44.607.png

-Jeff
Craige_Hales
Super User

Re: Image in a dashboard

And, if you don't like the ugly 1s and 2s, you can do this:

img = Open( "$SAMPLE_IMAGES/windmap.png", "png" );

gb = Graph Box(
	FrameSize( 1400, 880 ),
	X Scale( 0, 501 ),
	Y Scale( 0, 429 ),
	<<Add Image( image( img ), bounds( top( 429 ), Left( 0 ), bottom( 0 ), Right( 501 ) ) ), 
	// during construction for Y axis...
	<<yaxis( {show major labels( 0 ), show major ticks( 0 ), labels( 0 )} )
);
// after construction for X axis...
g = gb[framebox( 1 )]; // the actual graph is a framebox, down inside the graphbuilder
g << xaxis( show major labels( 0 ) ); // one
// or several...
g << xaxis( {show major labels( 0 ), show major ticks( 0 ), labels( 0 )} );

New Window( "my window", gb );

I mixed-and-matched two different ideas: if you can, do the xaxis inside the graph builder launch, like the yaxis. But if you need to adjust things later, do the yaxis like the xaxis, after the graph builder.

You can make an axis interactively then right-click->Edit->copyAxisSettings and paste that into a JSL editor to see all the possibilities that can go in the { list of axis options }. You might want to turn off the minor tick marks too, and that will show you how.

 

edit: also, Add Text to a Picture  if you really need to use a framebox. Otherwise, use @Mark_Bailey  solution, much simpler.

Craige