我有一系列光谱数据,我想在瀑布式图中绘制。瀑布本身没什么用,因为细线在每个光谱中有太多的差异,那不是很有用
因此,我想尝试功能区功能,这在docs 中看起来很有希望。
但结果完全不同,也没用!
figure(2); clf;
ribbon(spectralSeries);
shading flat % otherwise complete dark
axis tight
编辑:
我现在创建了一个手动瀑布图,它接近我想要的:
hold on;
stepsize = 0.35;
for k = length(series):-1:1
color = cmap(k,:);
data = spectralSeries(k,:) + (k-1)*stepsize;
hplot(k) = filledcurve(xaxis, data, 0);
set(hplot(k), 'FaceColor' , color*1.2)
set(hplot(k), 'EdgeColor' , color*0.5)
end
hold off;
axis tight
尽管如此,我仍然对原始问题的解决方案感兴趣。
编辑2:
这是一个使用瀑布、功能区和我的自定义代码的相同数据的示例。只有我的代码可用于可视化数据。我仍然想知道如何使丝带和瀑布看起来像一个体面的情节......
此代码现在用于创建一些数据
xaxis = linspace(-pi/2,3/2*pi, 1000);
variation = [ 0.5 1 5 10];
spectralSeries = abs(sin(xaxis)'*ones(1,4) + sin(xaxis'*variation)*0.25);
这是使用功能区的结果
ribbon(spectralSeries);
shading flat % otherwise complete dark
axis tight
这里有瀑布
hplot = waterfall(spectralSeries);
set( hplot, 'LineWidth', 4 );
hidden off;
为了比较使用我自己编写的代码的绘图,它类似于瀑布,但没有深度轴。然而,它是唯一一个看起来不错并显示数据曲线的模型,以便可以看到每条曲线之间的变化。