I'm trying to get the data from a zoomed-in MATLAB figure. I was able to get the XData and YData of the full field of view figure, as well as the XLim and YLim of the zoomed-in figure, but no more than that. Can someone advise me please?

8 visualizzazioni (ultimi 30 giorni)
h=get(Fig1);
axesObjs = get(h.Children); % axes handles dataObjs = axesObjs.Children; objTypes = get(dataObjs, 'Type'); % type of low-level graphics object xdata = get(dataObjs, 'XData'); % data from low-level grahics objects ydata = get(dataObjs, 'YData'); %% Zooming in axesObjs_crop = get(gcf); dataObjs_crop = axesObjs_crop.Children; objTypes_crop = get(dataObjs_crop, 'Type'); % type of low-level graphics object xlim = get(dataObjs_crop, 'XLim'); ylim = get(dataObjs_crop, 'YLim'); Fig2=figure(2); axis([xlim(1),xlim(2),ylim(1),ylim(2)]) hold on plot(xdata,ydata,'*') xlabel('X [nm]'); ylabel('Y [nm]');

Risposte (1)

Vineeth Kartha
Vineeth Kartha il 2 Feb 2016
Hi Guy Nir,
Refer the Axes properties and Chart Line properties in MATLAB documentation to get a list of all the properties associated with an axes and line object.
Now make use of the get command to retrieve the necessary information from the figure.
For example,
>> linewidth = get(dataObjs,'Linewidth');
>> color = get(dataObjs,'Color');
returns the Linewidth and the Color of the low-level graphic object, respectively.

Categorie

Scopri di più su Graphics Object Properties in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by