Displaying Images Using Annotate

The Annotate facility enables you to display an image at the coordinate location that you specify with the X and Y variables. To display an image, do the following:
  • Specify the image file in quotation marks on the IMGPATH variable.
  • Set the image coordinates with the X and Y variables.
  • Specify the IMAGE function.
One corner of the image is located by the current X and Y position. The opposite corner is located by the X and Y variables associated with the IMGPATH variable.
goptions reset=all border htitle=1.25
    hsize=5.5in vsize=4.2in;
data my_anno;
   length function $8;
   xsys="3";  ysys="3"; when="a";
function="move";  x=55;  y=55;  output;
function="image";  style="fit";  imgpath="external-image-file";
         x=x+15;  y=y+18;  output;
run;
title1 "GMAP with Annotated Image";
proc gmap data=maps.us map=maps.us anno=my_anno;
   id state;
   choro state/
   levels=1
   nolegend
   statistic=freq;
run;
quit;
The style="fit" variable on the IMAGE function stretches the image as needed to fill the area.
GMAP with Annotate
To tile the image to fill the area, set the STYLE variable equal to "tile".