MATLAB: How to access gscatter property and update data

figurehandlesplot

I want to assign new Data, XLims, YLims,… to my axis handle to display some other data on my figure. But I can't find the 'XData', 'YData' properties as there is in so many other axis prperties, so I still have the old data and not the updated one.
When I create a new handle with 'copyobj()' I get the new data on the figure. So there has to be some kind of data property. Where can I find it or what name has it?
Here is some dummy code so you can check for the properties:
load discrim
fig = figure;
gscatter(ratings(:,1),ratings(:,2),group,'br','xo')
xlabel('climate');
ylabel('housing');
ax = gca

Best Answer

h = gscatter(...)
gives you an array of 'Line' objects, which you can edit the properties of, including 'XData' and 'YData'