[Top][All Lists]

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

Re: contour

From: Shai Ayal
Subject: Re: contour
Date: Sat, 5 Mar 2005 13:23:38 -0600

Hi all,

Following Paul's request, I did some beatifying for the code I use in
octplot to turn it into something that could be enjoyed (?) by all
octave users. The zip archive consists of 3 files:

1. __contourc__.cc the low level c++ to compute contour levels,
adapted from plplot by Victor Munoz and myself
2. contourc.m -- basically just does input argument checking for
__contourc__ since I'm not that fluent in the octave c++ interface.
Someone with a bit more knowledge can easily integrate contourc and
__contourc__ into one c++ function. The interface of contourc is
matlab compatible
3. contour.m -- plots the output of contourc using gnuplot commands.
This has two problems stemming from the fact that octave can't read
gnuplot's state. contour.m must set "hold on"  and "gset nokey", but
it cannot restore them to their previous state.

This trio of files almost recreates the matlab contour command. Two
big missing things are contours for non-rectangular grids and support
for NaN's

I am of course open to suggestions on how to improve the code.
Hope this helps,

On Mon, 24 Jan 2005 13:56:10 -0500, John W. Eaton <address@hidden> wrote:
> On 24-Jan-2005, Daniel J Sebald <address@hidden> wrote:
> | Anyone recall the issue with the comment below?:
> |
> |  -- Function File:  contour (X, Y, Z, N)
> |      Make a contour plot of the three-dimensional surface described by
> |      Z.  Someone needs to improve `gnuplot''s contour routines before
> |      this will be very useful.
> |
> | What is the problem with gnuplot's contour?
> The problem I was thinking of when I wrote that comment was that
> gnuplot implements contour plots as a special type of 3D plot instead
> of a 2D plot.  So even though the final graph has only two dimensions,
> it has a much different appearance than other 2D plots produced by
> gnuplot and it is somewhat harder to combine a contour plot with
> general 2D data.
> I think it would also be nice if it could embed the contour levels in
> the plot lines (I recall that there were plotting packages from the
> mid-eighties (or even before) that could do this).  Maybe gnuplot has
> this feature now?  I haven't checked.
> jwe

Attachment: contour.zip
Description: Zip archive

reply via email to

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