% Thanks to <a href="http://www.mathworks.com/matlabcentral/profile/authors/3354683-yaroslav">Yaroslav Don</a> for his assistance in updating cursorbar for
% MATLAB Graphics and for his contribution of new functionality.
% Copyright 2003-2016 The MathWorks, Inc.
% Change Log:
% 13 Feb 2015: First version posted on the MathWorks file exchange.
% 14 May 2015: Added logarithmic scale support.
hText = get(hThis,'DisplayHandle');
if strcmp(hThis.ShowText,'off') || strcmp(hThis.Visible,'off')
if ~isempty(hText)
delete(hText);
hThis.DisplayHandle = gobjects(0);
return
end
return
end
% get the locations of the markers
if ~all(isvalid(hThis.TargetMarkerHandle))
return;
end
xData = get(hThis.TargetMarkerHandle,'XData');
yData = get(hThis.TargetMarkerHandle,'YData');
numIntersections = length(xData);
% get the handles for the text objects, corresponding to each intersection
hAxes = get(hThis,'Parent');
%%%%%%%%%%%%%
AXCOLOR = get(hAxes,'Color');
if ischar(AXCOLOR), AXCOLOR = get(hAxes,'Color'); end