0
我需要在我的图的附近创建滑块,并与其参数交互。 有人可以解释我如何在同一个图中创建它,将滑块参数的名称和值放在它附近,以及如何将它与我的情节链接?OCTAVE-创建一个图表在哪里放置交互式滑块,改变我的图的参数(在另一幅图中绘制)
谢谢。
我需要在我的图的附近创建滑块,并与其参数交互。 有人可以解释我如何在同一个图中创建它,将滑块参数的名称和值放在它附近,以及如何将它与我的情节链接?OCTAVE-创建一个图表在哪里放置交互式滑块,改变我的图的参数(在另一幅图中绘制)
谢谢。
看看demo_uicontrol.m其中有你所需要的:
一个精简例如,对于你问什么 “滑块靠近我的阴谋”
## Useful since Octave 4.0
close all
clear h
graphics_toolkit qt
h.ax = axes ("position", [0.05 0.42 0.5 0.5]);
function update_plot (obj, init = false)
## gcbo holds the handle of the control
h = guidata (obj);
a = get (h.slider1, "value");
w = get (h.slider2, "value");
x = linspace (0, 3);
y = a * sin (x * 5 * w);
if (init)
h.plot = plot (x, y, "b");
else
set (h.plot, "xdata", x);
set (h.plot, "ydata", y);
endif
guidata (obj, h);
endfunction
h.slider1 = uicontrol ("style", "slider",
"units", "normalized",
"string", "slider",
"callback", @update_plot,
"value", 0.4,
"position", [0.05 0.25 0.35 0.06]);
h.slider2 = uicontrol ("style", "slider",
"units", "normalized",
"string", "slider",
"callback", @update_plot,
"value", 0.7,
"position", [0.05 0.15 0.35 0.06]);
set (gcf, "color", get(0, "defaultuicontrolbackgroundcolor"))
guidata (gcf, h)
update_plot (gcf, true);
听起来像你需要一个图形用户界面 - 八度有一个'指导'功能? – etmuse