cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
BiX
BiX
Level II

Display PNG image from URL into a Wafer Map

Hello,

I would like to see a wafermap from CSV file ... ok

BiX_0-1669282556917.png

but I would replace each square by an PNG image from URL  defined into the same CSV file ...

Do you have some ideas how to do ???

17 REPLIES 17
BiX
BiX
Level II

Re: Display PNG image from URL into a Wafer Map

hi Jthi, thanks for your help.

But I obtain circles instead pokemon images .... a graph parameter to change ?

jthi
Super User

Re: Display PNG image from URL into a Wafer Map

Graph builder might be plotted from wrong data table. Based on window names: graph builder is using table Wafermap_pokemon_2 and data table is which is visible is Wafermap_pokemon_2 2). Maybe Wafermap_pokemon_2 data table doesn't have Image column properly set?

-Jarmo
BiX
BiX
Level II

Re: Display PNG image from URL into a Wafer Map

Hi Jthi,

thanks again.

Sorry, I have always point or circle instead of pokemon images.  

I suspect  the command "Set Shape Column(:Images))" is not functional on my side ?  (in V15.0.0 or V15.2.1)

 

BiX_0-1670316049874.png

 

 

jthi
Super User

Re: Display PNG image from URL into a Wafer Map

I'm not sure when it has been implemented (I'm using JMP16). You could try using the Images column as Marker column I suggested in my first message in this thread. Hopefully that works (you will have to remove that part from graph builder in that case I would think).

-Jarmo

Re: Display PNG image from URL into a Wafer Map

@jthi  has a good suggestion. Set Use for Marker was implemented in JMP 14 according to the Scripting Index:

John_Powell_JMP_0-1670332742111.png

When using a function for the first time, it's good to look it up in the Scripting Index under the Help menu.

You may also want to turn on the embedded log in the script editor, (Right-click > Show Embedded Log)  so you can see errors when you run your script.

John_Powell_JMP_1-1670333434735.png

 

Hope this helps, 

~John

 

 

 

 

BiX
BiX
Level II

Re: Display PNG image from URL into a Wafer Map

Thanks John,

I try to put in place your proposal inside Jthi's script without success ... 

Please could you propose to me your update ?

rgds 

 

 

"

Names Default To Here(1);
dt = Open(
"$DOWNLOADS/pokemons/Wafermap_pokemon.csv",
Import Settings(
End Of Line(CRLF, CR, LF),
End Of Field(Comma, CSV(1)),
Strip Quotes(0),
Use Apostrophe as Quotation Mark(0),
Use Regional Settings(0),
Scan Whole File(1),
Treat empty columns as numeric(0),
CompressNumericColumns(0),
CompressCharacterColumns(0),
CompressAllowListCheck(0),
Labels(1),
Column Names Start(1),
Data Starts(2),
Lines To Read("All"),
Year Rule("20xx")
)
);

dt:XCoord << Data type(Numeric) << Set Modeling Type(Ordinal);
dt:YCoord << Data type(Numeric) << Set Modeling Type(Ordinal);

// reduce Filename to only filename OR use full filepath and modify Images column's formula
dt:Filename << Set Each Value(Word(-1, :Filename, "\"));
Show(Get Default Directory());

// This can be modified to get borders and so on if needfed
dt << New Column("Images", Expression, None, << Set Each Value(
Open(Get Default Directory() ||"images/" || :Filename, png);
));

height = 20;
weight = 20;

gb = dt << Graph Builder(
Size(522, 451),
Show Control Panel(0),
Variables(X(:XCoord), Y(:YCoord)),

:Images << Set Use For Marker;
Bivariate( Y(:height),X(:weight) );
Bivariate[]
);

"

Re: Display PNG image from URL into a Wafer Map

Hi @BiX , 

The example I showed was for use with the Big Class Families.jmp sample data set. 'height', 'weight,' and 'picture' are columns in that data set, but are not in the table you create in your script.

To use 'Set Use For Marker' in your script, you need to send the 'Set Use For Marker' message to the 'Images' column that you create in your script before the Graph Builder function. 

To do this, replace everything starting with 'height = 20;' to the end with the following:

:Images << Set Use For Marker;
gb = dt << Graph Builder(
	Size( 522, 451 ),
	Show Control Panel( 0 ),
	Variables( X( :XCoord ), Y( :YCoord ) ),
	Elements( Points( X, Y, Legend( 1 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Marker Size( 15 ), Marker Drawing Mode( "Normal" )}
		)
	)
);

Notice that I added back the SendToReport code to set the Marker Size to 15 that you had earlier in this post.  If you change the size of the graph, you may want to change the Marker Size too.

Please let us know how that works out for you.

Thanks,

~John

BiX
BiX
Level II

Re: Display PNG image from URL into a Wafer Map

Hi John,

Thanks a lot !! Superbe !!

Thanks a lot Jthi,  for your help and your solution for JMP > v16

Solution for JMP v15 below

Merry Christmas  

Xavier

BiX_0-1670396603699.png

Script JMP V15 :

// JMP V15 
Names Default To Here(1);
dt = Open(
	"$DOWNLOADS/pokemons/Wafermap_pokemon.csv",
	Import Settings(
		End Of Line(CRLF, CR, LF),
		End Of Field(Comma, CSV(1)),
		Strip Quotes(0),
		Use Apostrophe as Quotation Mark(0),
		Use Regional Settings(0),
		Scan Whole File(1),
		Treat empty columns as numeric(0),
		CompressNumericColumns(0),
		CompressCharacterColumns(0),
		CompressAllowListCheck(0),
		Labels(1),
		Column Names Start(1),
		Data Starts(2),
		Lines To Read("All"),
		Year Rule("20xx")
	)
);

dt:XCoord << Data type(Numeric) << Set Modeling Type(Ordinal);
dt:YCoord << Data type(Numeric) << Set Modeling Type(Ordinal);

// reduce Filename to only filename OR use full filepath and modify Images column's formula
dt:Filename << Set Each Value(Word(-1, :Filename, "\"));
Show(Get Default Directory());

// This can be modified to get borders and so on if needfed
dt << New Column("Images", Expression, None, << Set Each Value(
	Open(Get Default Directory() ||"images/" || :Filename, png);
));

:Images << Set Use For Marker;
gb = dt << Graph Builder(
	Size( 522, 451 ),
	Show Control Panel( 0 ),
	Variables( X( :XCoord ), Y( :YCoord ) ),
	Elements( Points( X, Y, Legend( 1 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Marker Size( 15 ), Marker Drawing Mode( "Normal" )}
		)
	)
);