2

I have a series of spectral data which I want to plot in a waterfall style plot. waterfall itsself is no that usefull, because the thin lines have too many differences in each spectrum, that is is not very usefull

I therefore want to try the ribbon function, which looks promising in the docs .

But the result is completely different and useless!

figure(2); clf;
ribbon(spectralSeries); 
shading flat % otherwise complete dark
axis tight

enter image description here

EDIT:

I created now a manual waterfall plot, which is close to what I wanted:

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

enter image description here

Nevertheless I am still interested in a solution of the original problem.

EDIT 2:

Here an example using the same data with waterfall, ribbon and my custom code. Only my code is usefull to visualise the data. I would still like to know how to make ribbon and waterfall look like a decent plot...

This code is now used to create some data

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);

Here a result using ribbon

ribbon(spectralSeries); 
shading flat % otherwise complete dark
axis tight

enter image description here

And here with waterfall

hplot = waterfall(spectralSeries);
set( hplot, 'LineWidth', 4 );
hidden off;

enter image description here

and for comparison a plot using my own written code, which is similar to a waterfall, but without the depth axis. However it is the only one which looks decent and displays the data curves such that the variations between each curve can be seen.

enter image description here

Matthias Pospiech
  • 3,130
  • 18
  • 55
  • 76
  • What do you want the result to look like? – user1071136 Mar 06 '12 at 20:40
  • at least similar to the plot shown on the matlab docu: http://www.mathworks.de/help/techdoc/ref/ribbon.html – Matthias Pospiech Mar 07 '12 at 21:06
  • What does your data look like? What are its dimensions? – user1071136 Mar 07 '12 at 21:22
  • I added numerical data to make it possible for others to generate better looking examples. – Matthias Pospiech Mar 11 '12 at 17:56
  • You do not explain why the ribbon plot is bad (it does show the difference between different waves). Is it shading? the colors? It's still quite difficult to understand what kind of plot you're interested in. If your question is a general "how can this be done better" then it doesn't really fit on StackOverflow... If you post an image of a similar plot to what you're looking for, people may try to reproduce it. – user1071136 Mar 12 '12 at 13:14
  • Here are two example which look like what I would expect: http://2.bp.blogspot.com/_jYbplShnbn8/Siuper9GD6I/AAAAAAAAAFI/LnQXyTUd8eY/s400/wall.png and http://austringer.net/images/biosonar/wfall_demo.png – Matthias Pospiech Mar 13 '12 at 17:43
  • Please put the images directly into the question, in case blogspot stops hosting it. Also, I'd recommend removing the entire "EDIT 2" part. – user1071136 Mar 14 '12 at 07:52

1 Answers1

3

You can still use waterfall, but set some patch and axes properties to get nicer output. The important thing to notice is that spectralSeries should be transposed.

figure
xaxis = linspace(-pi/2,3/2*pi, 200);
variation = [ 0.5 1 5 10 7 3.5 8];
spectralSeries = abs(sin(xaxis)'*ones(1,7) + sin(xaxis'*variation)*0.25);
h = waterfall(spectralSeries');
cameratoolbar;

%%
set(h, 'FaceColor', 'flat');
set(h, 'FaceAlpha', 0.7);
set(h, 'EdgeColor', 'k');
set(h, 'FaceVertexCData', rand(7,3))
set(gca, 'Color', [1 1 1]*0.85)
set(gca, 'GridLineStyle', 'none');

%%
myaa

The (optional) last statement, myaa, produces an anti-aliased figure; get the script here.

enter image description here

user1071136
  • 15,636
  • 4
  • 42
  • 61