html - 可以将交互式 MATLAB 图形导出为 HTML 吗?
问题描述
我想将包含滚动条的交互式图形导出为 HTML 或类似的东西;以便没有 MATLAB 的最终用户可以交互地使用该图。
不确定这是否可行。
我发现了一些与 3D 绘图相关的函数,但是没有一个函数适合我要导出的图形类型。
示例代码:
% Generate and plot data
x=0:1e-2:2*pi;
y=sin(x);
dx=2; % dx is the width of the axis 'window'
a=gca;
p=plot(x,y);
% Set appropriate axis limits and settings
set(gcf,'doublebuffer','on');
%% This avoids flickering when updating the axis
set(a,'xlim',[0 dx]);
set(a,'ylim',[min(y) max(y)]);
% Generate constants for use in uicontrol initialization
pos=get(a,'position');
Newpos=[pos(1) pos(2)-0.1 pos(3) 0.05];
%% This will create a slider which is just underneath the axis
%% but still leaves room for the axis labels above the slider
xmax=max(x);
S=['set(gca,''xlim'',get(gcbo,''value'')+[0 ' num2str(dx) '])'];
%% Setting up callback string to modify XLim of axis (gca)
%% based on the position of the slider (gcbo)
% Creating Uicontrol
h=uicontrol('style','slider',...
'units','normalized','position',Newpos,...
'callback',S,'min',0,'max',xmax-dx);
解决方案
推荐阅读
- javascript - 如何在 JavaScript 中解析时间?
- python - 绘制从 xarray 数据集到 AxesGrid 的子图
- flutter - 使用令牌和云函数的最佳 FCM 方法
- prolog - 解释基本 Prolog 结果
- angular - 从 JAX-RS ContainerRequestFilter 重定向到 Angular 路由
- javascript - URLSearchParams API 总是从 url 解析返回一个空对象
- ios - 如何下载旧版 Agora.io iOS SDK?
- php - 过滤多匹配 ES PHP
- r - R: st_within 计算空间对象的时间太长
- excel - Excel 中的动态公式帮助