User`s guide

Create Image Maps
13-85
Create Image Maps
You can specify areas of an image to be links. Clicking the link area in an image in an
HTML browser opens the target. You can map different areas in an image to different
link targets.
1
Create an mlreportgen.dom.ImageArea object for each image area that is to serve
as a link. You can specify text to display if the image is not visible.
You can specify an image area to have one of these shapes:
Rectangle
Circle
Polygon
For details, see mlreportgen.dom.ImageArea.
2
Create an mlreportgen.dom.ImageMap object to associate the link areas with the
image. Append the ImageArea objects to the ImageMap object.
For example, you can create a link from a plot image to documentation about plotting.
import mlreportgen.dom.*
d = Document('imageArea','html');
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y);
annotation('textbox',[0.2,0.4,0.1,0.1],...
'String','Help for plot function');
saveas(gcf,'plot_img.png');
plot1 = Image('plot_img.png');
append(d,plot1);
area1 = ImageArea(...
['http://www.mathworks.com/help/matlab/ref/' ...
'plot.html?searchHighlight=plot'], ...
'plot function help',240,450,463,492);
map = ImageMap();
plot1.Map = map;
append(map,area1);