Using clickableLegend() with Errorbar() for Interactive Data Highlighting and Display
显示 更早的评论
I've run into an issue using clickableLegend() which I have found to be very useful for interactively highlighting and displaying data on a single figure. The original version has an error which is addressed in the attached clickableLegend2() script, as described in the discussion section for this function.
I have encountered an error while trying to use clickableLegend() with errorbar() instead of plot():
Here is an example recreating the error, which does not happen when plot() is used instead of errorbar():
clear all;close all;
z = peaks(100);
errorbar(z(:,26:5:50),z(:,26:5:50)*.1)
grid on;
axis manual;
clickableLegend({'Line1','Line2','Line3','Line4','Line5'}, 'Location', 'NorthWest');
----------------
Error Message:
Index exceeds the number of array elements. Index must not exceed 0.
Error in clickableLegend (line 91)
set(objhan(i), 'HitTest', 'on', 'ButtonDownFcn',...
Any Help resolving this would be much appreciated!
Thanks
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Errorbars 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!