[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octaviz help, general question about plotting scattered
From: |
Jonathan Stickel |
Subject: |
Re: Octaviz help, general question about plotting scattered |
Date: |
Wed, 18 Jul 2007 19:48:32 -0600 |
User-agent: |
Thunderbird 2.0.0.0 (X11/20070326) |
Sorry to break the thread... replying to a digest.
Jordi
You can use the function griddata.m (geometry package of octave-forge, I
think) to do what you want. First define a regular grid, and then run
griddata to interpolate your random points onto the grid. For example,
> [X,Y]=meshgrid(xlo,xspan,xhi,ylo:yspan:yhi);
> Z = griddata(x,y,z,X,Y);
> vtk_surf(X,Y,Z)
where lower case x,y,z are your set of points. Unfortunately, you will
need to modify the griddata function at line ~52:
tri=delaunay(x,y,"QJ");
i.e. the "QJ" option must be used, or you will get segfaults since you
are mapping to a regular grid. (I tried to have this change checked in
a couple years ago, and it was not accepted. I don't know why!)
In your original post, you mention two other things. About animations,
I have found this mencoder command to work well for me (all one line):
$ mencoder mf://*.jpg -mf fps=20:type=jpg -ovc lavc -lavcopts
vcodec=mpeg4:vbitrate=5000 -o output.avi
This can be used to animate a sequence of jpg files generated by
octave/octaviz. The frame rate can be set easily with the fps option.
At some point, I figured out how to convert the mpeg encoding to
something quicktime could use, but I don't remember how right now.
About colormaps in octaviz, you can set different colormaps using
vtk_colormap. The simplest usage is using pre-defined colormaps from
octave-forge, e.g. jet. But you can define your own colormap as a 3
column matrix of r,g,b values. I haven't done this myself, and so you
may need to experiment a little bit to get what you want.
Nice to know others are using Octaviz!
Regards,
Jonathan
Date: Tue, 17 Jul 2007 15:56:58 -0500
From: " Jordi Guti?rrez Hermoso " <address@hidden>
Subject: Re: Octaviz help, general question about plotting scattered
data
To: octave-help <address@hidden>
Message-ID:
<address@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 17/07/07, Carlo de Falco <address@hidden> wrote:
On 17/lug/07, at 03:33, Jordi Guti?rrez Hermoso wrote:
My second question is no doubt more complex. Suppose I have scattered
data points on some unstructured grid on the plane, and I have a
function value at each point. That is, the only data I have is a bunch
of (x,y,z) triplets that can be given to me in any order. They should
represent samplings from a smooth function, hopefully a solution to a
shallow water equation without shocks, once I get my code working. How
can I form a quasi-smooth surface which interpolates with small
polygons the data points that I give?
If I understand what you want to do,
you could use the function "delaunay" from the geometry package in o-f
for creating a triangulation and then the functions in the package
FPL to plot the data.
Thanks, I do think that's exactly what I want! Except that I really
want to plot with Octaviz... I really need to dig into its VTK
internals, I guess.
- Jordi G. H.
- Re: Octaviz help, general question about plotting scattered,
Jonathan Stickel <=