data extract from 3d line plot?
4 次查看(过去 30 天)
显示 更早的评论
回答(2 个)
Max Murphy
2019-12-28
See example code and modify according to your data:
%% Make test data
fig = figure;
ax = axes(fig);
nPoint = 1001;
nSeries = 5;
k = ones(nSeries,1) * linspace(0,100,nPoint);
theta = randn(nSeries,1);
% Toy x-data
x = cos(k.*2*pi*0.1+2*pi.*theta).^(randi(4,5,1)).*(randn(nSeries,1) * 10);
% Toy y-data
y = randn(nSeries,nPoint) .* (randn(nSeries,1) * 10);
% Toy z-data
z = sin(k.*2*pi*0.1 + 2*pi.*theta).*(randn(nSeries,1) * 10);
% Labels
lab = cell(nSeries,1);
for i = 1:nSeries
lab{i} = sprintf('TestData %g',i);
end
% Plot them
plot3(ax,x.',y.',z.');
legend(lab);
%% Get 3D data
% Can use 'gca' here if don't have 'ax' handle
c = findobj(ax,'Type','line');
% c = findobj(gca,'Type','line'); % should work for your data
% This returns data in cell array, where each element matches
X = get(c,'XData'); % X{1,1} corresponds to Y{1,1} and Z{1,1}
Y = get(c,'YData'); % Y{2,1} corresponds to X{2,1} and Z{2,1} etc
Z = get(c,'ZData');
0 个评论
Image Analyst
2019-12-28
If all you have is that one 2-D image, you can't. Exactly what data do you have? Are you the one who plotted it? If not, can you get it from them. Otherwise can you get the formulas that made those curves?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!