Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Level VI

## Add Image Label to Graph

Hi,

Using JMP12 and an Expression column, how can I add an image label to a graph?  The mouse over image is great, but I am having trouble getting the image label to stay visible to add to a journal, presentation, etc.  Any suggestions?  Thanks!

Names Default To Here( 1 );

dt = Open( "\$SAMPLE_DATA/Big Class.jmp" );

dt << New Column( "Image",

Expression,

Set

Formula(

New Image(

Open(

"png"

)

)

)

);

dt << Set Label Columns( :name, :Image );

dt << Select Where( :name == "LAWRENCE" ) << Label( 1 ) << Clear Select;

dt << Bivariate( Y( :height ), X( :weight ) );

// :name label is visible in graph, :Image label is not.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User

## Re: Add Image Label to Graph

You can pin the label. To do it by hand just mouse over the marker and place the pointer on top of the label box to reveal the pin.

The same thing can be done by sending <<Add Pin Annotation to the FrameBox, but the parameters can be tricky to get right.

I would first pin and position the label by hand and then copy the script. See the example below:

Names Default To Here(1);

dt = Open("\$SAMPLE_DATA/Big Class.jmp");

dt << New Column("Image", Expression, Formula(New Image(Open("\$SAMPLE_IMAGES/pi.gif", gif))));

dt << Set Label Columns(:Image);

//dt << Select rows( label_row) << Label( 1 ) << Clear Select;

dt << Bivariate(

Y(:weight),

X(:height),

SendToReport(

Dispatch(

{},

"Bivar Plot",

FrameBox,

Add Pin Annotation(

Seg(Marker Seg(1)),

Index(39),

Index Row(-1),

Origin({70, 172}),

Offset({30, 16}),

Tag Line,

Font("Helvetica", 11, "Plain")

)

)

)

);

Current Report() << size window(475, 374);

2 REPLIES 2
Highlighted
Super User

## Re: Add Image Label to Graph

You can pin the label. To do it by hand just mouse over the marker and place the pointer on top of the label box to reveal the pin.

The same thing can be done by sending <<Add Pin Annotation to the FrameBox, but the parameters can be tricky to get right.

I would first pin and position the label by hand and then copy the script. See the example below:

Names Default To Here(1);

dt = Open("\$SAMPLE_DATA/Big Class.jmp");

dt << New Column("Image", Expression, Formula(New Image(Open("\$SAMPLE_IMAGES/pi.gif", gif))));

dt << Set Label Columns(:Image);

//dt << Select rows( label_row) << Label( 1 ) << Clear Select;

dt << Bivariate(

Y(:weight),

X(:height),

SendToReport(

Dispatch(

{},

"Bivar Plot",

FrameBox,

Add Pin Annotation(

Seg(Marker Seg(1)),

Index(39),

Index Row(-1),

Origin({70, 172}),

Offset({30, 16}),

Tag Line,

Font("Helvetica", 11, "Plain")

)

)

)

);

Current Report() << size window(475, 374);

Highlighted
Level VI

## Re: Add Image Label to Graph

Thanks MS!

Article Labels

There are no labels assigned to this post.