I have a custom-class that I am using with a GUIDE-generated GUI. I want to create custom data-cursors. However, when I try to pass the axes-object to 'datacursormode(figure_handle)', I get the error 'Invalid figure handle'. My constructor is attached below. Any help is appreciated.
% Constructor
function obj = annotatorGUIClass(rawAxes, psdAxes, allAxes, parentFigure) obj.rawDataDisplayAxes = rawAxes; obj.psdDataDisplayAxes = psdAxes; obj.allPairDisplayAxes = allAxes; obj.dcmRaw = datacursormode(rawAxes); obj.dcmPSD = datacursormode(psdAxes); obj.rawDataDisplayAxes.NextPlot = 'replacechildren'; obj.psdDataDisplayAxes.NextPlot = 'replacechildren'; obj.allPairDisplayAxes.NextPlot = 'replacechildren'; obj.viewMode = 'Raw'; parentFigure.Renderer = 'painters'; end
Best Answer