Is there a way to determine which function (e.g., quiver(), scatter(), contour(), etc.) was used to generate a particular hggroup? For example, suppose I have the following:
dat = rand(20,4);
q= quiver( dat(:,1), dat(:,2), dat(:,3), dat(:,4), 0, 'blue');
s = scatter( dat(:,1), dat(:,2), 100*dat(:,3), 'red', 'filled');
[~, c] = contour( dat, 5);
obj = findobj(gca, '-depth', 1, '-not', 'type','axes');
objTypes = get(obj,'type')
All of the values of 'objTypes' are 'hggroup'. Is there a way to distinguish between these various objects?
Currently, I am just checking for a property that I know exists in, for example, a quiver object but not a scatter object, to infer the function used to generate this.
quiverCorrect = obj(isprop(obj, 'AutoScaleFactor')) == q,
scatterCorrect =obj(isprop(obj, 'SizeData'))==s,
contourCorrect = obj(isprop(obj,'ContourMatrix'))==c,
However, I imagine there's a more elegant and foolproof way to do this. I inspected the children of each of these objects, but as the child objects are just lines and patches, they didn't seem to provide much insight.
Any help you can provide would be appreciated.