matlab 连接多个点,matlab创建一个到多个数据源的链接点击图像映射图

Attributed Plot Html

This exchange file creates a plot of data and an accompanying html imagemap so that a figure can be published on the web that includes clickable links to multiple data sources. It’s useful to fully attribute plotted data, even when a single plot has many sources.

The AttributedPlotHtml.m function creates a png image file of a MatLab plot and an image map with specific pixel locations of each data point. It additionally produces a simple html file that displays the plot with optional links to the data source of each data point. An instructional README file explains how to implement your uniquely created html and png files so you can display them on your webpage.

The function is autonomous, so if it is executed without input arguments it will produce a sample "AttributedData" html page that displays the image and imagemap outputs.

The next simplest execution of the function only requires the Dim2Data input argument, a 2D matrix with x and y data columns. The resulting imagemap and html can be customized, for example with an html editor.

The optional second argument, ImageName, assigns imagename as the title of the png and html files.

Finally, you can include a third argument: the Crux object. The Crux object has many optional fields to populate to make specific content and style selections:

- Recommended Crux Properties:

- Crux.blurbs - Array of strings with length equal to Dim2Data,

- - brief description of data source

- Crux.links - Array of strings with length equal to Dim2Data,

- - link to source of form: "http://www.google.com/"

- Crux.xlab - string with label for x-axis

- Crux.ylab - string with label for y-axis

- Crux.imagewidth - number - width of image in inches (rec:5)

- Crux.imageheight - number - height of image in inches (rec:3)

- Optional Crux Properties:

- Crux.plottitle - string title for plot

- Crux.title - string title for html page

- Crux.linksx - Array of strings with length equal to Dim2Data,

- - link to source of x data (if different than y)

- - of form: "http://www.google.com/"

- Crux.slinkFormat - string for sprintf to represent y data magnitude

- - ex: '%0.0f' for '54' output from 54.367 input

- - ex: '%0.2f' for '54.36' output from 54.367 input

- Crux.slinkxFormat - string for sprintf to represent x data magnitude

- Crux.plotfun - anonymous function that defines plot

- - see help function_handle for use syntax

- - must have only two inputs, xdata and ydata

- Example

- Crux.plotfun = @(xx,yy) plot(xx,yy,'.','MarkerSize',13);

The download includes EXAMPLE_marathons.m which is a sample data file with input fields for AttributedPlotHtml. It creates a race day temp vs. marathon time plot, html file, and png. EXAMPLE_marathons.m is an autonomous code that can be executed without an input argument.

Acknowledgments: This creation of this function was greatly expedited by the code sample by Adam C. Finnefrock http://www.mathworks.com/matlabcentral/newsreader/view_thread/12571

If you are only interested in an image map, makemap.m produces an image map from any plotted figure: http://www.mathworks.com/matlabcentral/fileexchange/3893-save-with-image-map/content/makemap.m

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值