help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plotting problem


From: Matthias Brennwald
Subject: Re: Plotting problem
Date: Tue, 2 May 2006 21:54:44 +0200

Thanks, I believe that might indeed help. Your example works well in 2-D. However, I want this to be a 3-D plot, so I'll have to use the 'mesh' command, I believe. But that still gives transparent polygons...

Cheers,
Matthias


On 02.05.2006, at 16:39, Etienne Grossmann wrote:


  Hi Matthias,

shing like

  xx = linspace (-7,7,100);
  y1 = sin (xx); y2 = 0.8*sin(xx+pi/6); y3 = 0.64*sin(xx+pi/3);
  __gnuplot_raw__ ("set style data filledcurves y1=0;\n")
  plot (xx,y1,xx,y2,xx,y3)

?

  Hth,

  Etienne

On Tue, May 02, 2006 at 03:25:33PM +0200, Matthias Brennwald wrote:
# Dear all,
#
# before reading further, a short warning: I'm a newbie (both with
# Octave and with this list), so...
#
# I am trying to write some code that plots a "waterfall diagram" (aka. # "cumulative spectral decay diagram", CSD diagram). An example of such
# plot is available here: http://www.euronet.nl/users/temagm/audio/
# waterfall_focal.htm
#
# I want this code to work both under Matlab and Octave. I use Octave
# 2.1.72 on the Mac, but the code should not be limited to this
# specific setup.
#
# My approach to plotting the waterfall is this (see also example code
# below): first, plot the curve in the back as a filled polygon. Then,
# plot the next curve also as filled polygon above the one in the back;
# and continue in the same way until the frontmost curve. With Matlab,
# I can use 'fill3' easily plot these polygons. With plain vanilla
# Octave, the only options I have is 'mesh' or '__gnuplot_splot__',
# which I cannot make plot FILLED polygons. (I also tried the 'fill3'
# command from Octave-forge, but with no luck. Also, I want my code to
# be independent of Octave-forge, because Octave-forge is not available
# as a 'stable' version from Fink for easy installation on the Mac.)
#
# Any help or ideas?
#
# Matthias
#
#
#
#
# An example illustrating my approach (and problem) is this:
#
# **********************
# % First, make up three curves z(x) to play with. Each of the curves
# have constant y (y=1,2,3):
# x = [0:100];
# y = [ 0:2 ];
# z = [   2+sin(x/10);
#          1.8 + 0.8*sin(x/11);
#          1.5 + 0.6*sin(x/12); ];
#
# % append some points so we get closed curves:
# x = [ x x(end) x(1) x(1) ];
# z = [ z [0 0 0]' [0 0 0]' z(:,1) ];
#
# for n=1:3
#      if exist('OCTAVE_VERSION') % we're running Octave
#          mesh(x,y(n),z(n,:)); % this plot TRANSPARENT polygons
#      else % we're running Matlab
#          poly=fill3(x,repmat(y(n),1,length(z(n,:))),z(n,:),'w'); %
# this plots a filled polygon with fill color 'white'
#          set(poly,'EdgeColor','r'); % this sets the edge of the
# polygon to 'red'
#      end
#      hold on
# end
#
# hold off
# **********************
#
#
#
#
# -------
# Matthias Brennwald
# Lägernstrasse 6
# CH 8037 Zürich
# +41 (0)44 364 17 03
# address@hidden
#
#
#
# _______________________________________________
# Help-octave mailing list
# address@hidden
# https://www.cae.wisc.edu/mailman/listinfo/help-octave

--
Etienne Grossmann ------ http://www.cs.uky.edu/~etienne



-------
Matthias Brennwald
Lägernstrasse 6
CH 8037 Zürich
+41 (0)44 364 17 03
address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]