简体   繁体   English

以八度为单位获取绘图上数据点的值

[英]Getting value of data point on a plot in octave

I am trying out octave as an alternative to matlab and it looks like the graph plot in octave is not as interactive as matlab我正在尝试使用八度音程作为 matlab 的替代品,看起来八度音程中的图形不像 matlab 那样具有交互性

I want to find out the value of the x and y coordinates of a data point on the plot by clicking on it我想通过单击来找出图中数据点的 x 和 y 坐标值

I have seen the ginput function, but while my figure is open, if I call the function, click on a point in the figure and then press the Enter key, I get the following result:我已经看到了ginput函数,但是当我的图形打开时,如果我调用该函数,单击图形中的一个点,然后按 Enter 键,我得到以下结果:

[x, y, buttons] = ginput ()  
x = [](0x0)
y = [](0x0)
buttons = [](0x0)  

While messing around I did manage to get proper coordinate values once在胡闹时,我确实设法获得了一次正确的坐标值

figure(1); [x, y, buttons] = ginput ()
x =  69.09677419354838
y =  127.2917862029395
buttons = 13  

but I am not sure what I did different, and I haven;t been able to make it happen again但我不确定我做了什么不同的事情,而且我还没有能够让它再次发生

How can I click on a data point in in Octave figure and find it's value (both x and y, or at least just y)?如何单击 Octave 图中的数据点并找到它的值(x 和 y,或至少只是 y)? Is it possible to select an exact data point on a plot using the ginput or any other function in Octave?是否可以使用 ginput 或 Octave 中的任何其他函数在绘图上选择精确的数据点?

The behaviour described above seems to be a bug with the QT interface.上面描述的行为似乎是 QT 界面的一个错误。 The fltk interface works as expected. fltk 界面按预期工作。 Try:尝试:

graphics_toolkit fltk

to enable it.启用它。

I will file a bug in the meantime.在此期间,我将提交一个错误。 bug submitted提交错误

PS.附注。 Keyboard events seem to be detected normally, but mouse events are not, hence the empty lists.键盘事件似乎被正常检测到,但鼠标事件没有被检测到,因此是空列表。 The '13' accidental output must have been from pressing 'small enter' and registering a newline keyboard event, before pressing 'big enter' thus forcing ginput to return. '13' 的意外输出必须是按下 'small enter' 并注册换行键盘事件,然后按 'big enter' 从而迫使ginput返回。

UPDATE it appears that switching back to the qt interface and trying again now allows mouse events to work.更新似乎切换回 qt 界面并再次尝试现在允许鼠标事件工作。 This has persisted following an octave restart.在八度音程重新启动后,这种情况一直存在。 Weird bug.奇怪的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM