Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Apr 2010 21:21:04 +0200
From:      Alexey Shuvaev <shuvaev@physik.uni-wuerzburg.de>
To:        Robert Huff <roberthuff@rcn.com>
Cc:        ports@freebsd.org
Subject:   Re: looking for simple 3d plotting program
Message-ID:  <20100408192104.GA59297@wep4035.physik.uni-wuerzburg.de>
In-Reply-To: <19389.61611.793371.369489@jerusalem.litteratus.org>
References:  <19389.58542.758803.443167@jerusalem.litteratus.org> <19389.61611.793371.369489@jerusalem.litteratus.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Apr 08, 2010 at 11:05:15AM -0400, Robert Huff wrote:
> 
> Robert Huff writes:
> 
> >  	I have a project for which I need to produce a {gif, jpg, png}
> >  of a 3d space, with labled axes, and plot a small number (<25 ??) of
> >  points within it, either with labels or as icons.
> >  	Two constraints:
> >  	Current code is written in C.
> 
> 	I expressed myself badly.  What I should have said was:
> 
> 	It must be usable via C function calls.
> 
Not the best and the most elegant way to achieve this, but...
you can try math/gnuplot. It can do 3d.

--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=Makefile

CC=gcc
CCFLAGS= -g -Wall 
LDFLAGS= -lm -lpthread

target= testgnuplot
objects= testgnuplot.o gnuplot.o

all: $(target)

$(target): $(objects) 
	$(CC) $(LDFLAGS) $(objects) -o $@ 

%.o: %.c
	$(CC) $(CCFLAGS) -c $< -o $@

clean:
	rm -f $(objects)
	rm -f $(target)

--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=README

gnuplot.c implements a helper function that invokes gnuplot
to display the acquired data. 

You need to have the gnuplot package installed to take advantage
of this function.

You can reuse it in your program by adding the gnuplot.c and 
gnuplot.h files to your project and calling the function:

int sendDataToGnuplot(int handle, float x0, float dX,
                      double *buffer, int nbOfPointsPerCh,
                      int nbOfCh);

handle is the handle of the acquisition session returned by _PdAquireSubsystem.
x0 is the origin of the x axis
dX is the increment between each points on the x axis
buffer contains the acquired data
nbOfPointsPerCh contains the number of sampels acquired for each channel
nbOfCh contains the number of channels
		      

--bg08WKrSYDhXBjb5--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100408192104.GA59297>