MATLAB - Figure Data Abstraction

Provided a MATLAB figure file, e.g. FILE.fig, the original data can be abstracted by following procedure.

open('FILE.fig'); % open the figure file
fig_handle = findall(gca, 'type', 'line'); % get figure handle
x = get(fig_handle, 'xdata'); % get data of X-axis
y = get(fig_handle, 'ydata'); % get data of Y-axis