Thanks a lot Jthi, for your help and your solution for JMP > v16
Solution for JMP v15 below
Merry Christmas
Xavier
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" )}
)
)
);
You can try to use images as markers Using JMP > JMP Reports > Use Markers in Graphs > Use Images as Markers after you have the images in the data table. And how to get those images depends a lot on how your urls work. You might be able to use Expression column with formula like Open(url). Getting the sizes right might require some tinkering.
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(1),
New Column("url",
Character,
"Nominal",
Set Values(
{
"https://www.jmp.com/en_us/download-jmp-free-trial/_jcr_content/par/contenttargetingcont/par_off/styledcontainer_cdbe/par/image_f589.img.png/1520449222936.png"
}
)
),
New Column("Column 2", Expression, "None", Formula(Open(:url)), Use for Marker)
);
gb = dt << Graph Builder(
Size(496, 466),
Show Control Panel(0),
Variables(X(:url)),
Elements(Points(X, Legend(2)))
);
It might also be a good idea to prevent the images from being downloaded again if they have been downloaded once
put the images into graphs, using the X and Y axes to position and scale and the order of the images to determine what is on top.
use the image functions to load and crop and size image objects (which can be saved as PNG or JPG when done.)
move the image objects into matrices and use matrix operations to manipulate the pixels. Move back to image objects to save a picture.
You'll want to use (1) if you are building a graph already. Look at the second answer, around here:
// you could use a loop to add a bunch of images to the framebox
// <<AddImage adds at the FRONT of the display list. The first
// image added will be drawn last, on top of the 2nd image added.
gb[framebox(1)]<<Add Image( image( overlay2 ), bounds( top( 50 ), Left( 155 ), bottom( 50+yOverlay2Size ), Right( 155+xOverlay2Size + 1 ) ) );
gb[framebox(1)]<<Add Image( image( overlay1 ), bounds( top( 50 ), Left( 20 ), bottom( 50+yOverlay1Size ), Right( 20+xOverlay1Size + 1 ) ) );
gb[framebox(1)]<<Add Image( image( original ), bounds( top( 0 ), Left( 1 ), bottom( ySize ), Right( xSize + 1 ) ) );
Tous, Merci de vos propositions. je vais les essayer.
je vais deja essayer de faire apparaitre les images dans une colonne de ma table car je ne suis pas sur du format de l URL avec un chemin type windows (ex: //server.com/directory/image.png)
si vous avez des propositions de codes pour l affichage d image dans une data base JMP ... je suis interesse.
Desole, je suis debutant et ne reussi pas, meme avec vos conseils, a realiser ce graph, avec les images et le fichier csv en entree. je renouvèle ma demande d aide. merci par avance
Leave Filename column as Character. I would also suggest using full paths of the images as it makes it easier to load the images (if you cannot do that, it might be easiest to use Get Default Directory() or Convert File Path() to build those for image loading column). Also using images as markers will make them (most likely) dependent on the graph size and used marker size. If all images are same size and you don't need graph builder, building custom display can also be an option.
My images, csv and images are in Downloads/pokemons folder
Names Default To Here(1);
dt = Open(
"$DOWNLOADS/pokemons\Wafermap_pokemon_2.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);
));
gb = dt << Graph Builder(
Size(522, 451),
Show Control Panel(0),
Variables(X(:XCoord), Y(:YCoord)),
Elements(Points(X, Y, Legend(3), Set Shape Column(:Images))),
SendToReport(
Dispatch(
{},
"Graph Builder",
FrameBox,
{Marker Size(15), Marker Drawing Mode("Normal")}
)
)
);
dt << New Column("ImagesWithBorder", Expression, None, << Set Each Value(
Local({bb, img},
bb = Border Box(Left(15, Empty()), Right(15, Empty()), Top(15), Bottom(15),
img = Picture Box(Open(Get Default Directory() ||"images/" || :Filename, png))
);
bb << Background Color("Orange");
img << Background Color("White");
bb << Get Picture;
);
));
gb = dt << Graph Builder(
Size(457, 714),
Show Control Panel(0),
Variables(X(:XCoord), Y(:YCoord)),
Elements(Points(X, Y, Legend(3), Set Shape Column(:ImagesWithBorder))),
SendToReport(Dispatch({}, "Graph Builder", FrameBox, {Marker Size(30), Marker Drawing Mode("Normal")}))
);
Data table:
Without borders and marker size as 15
Borders and marker size 30:
If I modify graph size the marker size won't keep up: