help-octave
[Top][All Lists]
Advanced

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

Re: 3 D plot


From: Jordi Gutiérrez Hermoso
Subject: Re: 3 D plot
Date: Sun, 18 Mar 2012 12:07:20 -0400

2012/3/15 asha g <address@hidden>:

> > From: Jordi Gutiérrez Hermoso <address@hidden>

> > 2012/3/15 asha g <address@hidden>:
> >>> From: Jordi Gutiérrez Hermoso <address@hidden>
> >>> On 14 March 2012 05:25, asha g <address@hidden> wrote:
> >>>> I have written:
> >>>>
> >>>> x = linspace ( 0,tmax,niter)
> >>>> z = linspace (0,X,N)
> >>>> y = vvvv(niter,N)
> >>>> [xx,zz] = meshgrid(x,z)
> >>>> mesh(xx,y,zz)
> >>>> surf(vvvv)
> >>>>
> >>>> I  get nothing.
> >>>
> >>> Neither do I. Nothing wrong, I mean. I need to know the rest of
> >>> your values in order to diagnose what you might have. I also
> >>> need to know what kind "nothing" are you getting.
> >>>
> >>> I am able to use mesh and surf fine, making up numbers on my
> >>> own.
> >
> >> Am attaching a script file related to this.
> >> tmax = 55
> >> niter = 6182
> >> x = linspace  (0,400*10^-4,N)
> >> N = 10
> >> X= x/lambda
> >> lambda = 0.10536
> >> vvvv is generated from the program and is V wrt t and X
> >>
> >> I  get nothing - basically - the plot does not come up in mesh
> >> and with surf I get a black rectangle.
> >
> > Right... I think vvvv is the crux of the matter here. I can't easily
> > guess what values it has in your script.
> >
> > Can you save vvvv, gzip the resulting file and attach it with your
> > next message?

> This one has mat - binaries  for just x, z, and vvvv
> please let me know if you can open it.

I don't really understand what is happening with y and your
mesh(xx,y,zz) call. There y is a scalar, but the mesh call expects all
three arguments to be of the same size, as resulting from meshgrid. So
normally you should do something like

   [xx, yy] = meshgrid (x, y);
   zz = some_function_of (xx,yy);
   mesh (xx, yy, zz);

The black rectangle in the surf call occurs because your vvvv is too
big and by default black outlines blacken the whole thing. On the
current development version, with the OpenGL backend I can do "shading
flat" to get rid of the black outlines and produce the figure below:

    http://picpaste.com/pics/asha-kDh0rAIS.1332086819.png

HTH,
- Jordi G. H.


reply via email to

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