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?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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]');
0 commentaires
Réponses (1)
Vineeth Kartha
le 2 Fév 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.
For example,
>> linewidth = get(dataObjs,'Linewidth');
>> color = get(dataObjs,'Color');
returns the Linewidth and the Color of the low-level graphic object, respectively.
0 commentaires
Voir également
Catégories
En savoir plus sur Graphics Object Properties dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!