Plotting Using PLPlot

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Sun May 10 14:46:13 PDT 2009


dsimcha wrote:
> It seems like there's substantial interest in this.  Please give me some use
> cases, i.e. what would you personally use this for, and what do you foresee others
> using it for, so I can start thinking about what the API should be.  I need a wide
> variety of use cases because, if I design the API based only on my personal use
> cases, it will end up being geared entirely toward histograms, scatter plots, and
> line graphs because that's what I use regularly.
> 
> Besides use cases, here are some specific questions:
> 1.  Is there any need for an OO-based API, or should I just use free functions?
> 2.  Does anyone have any use cases where plotting is performance critical, or
> should I just keep things simple/stupid in terms of the performance/simplicity
> tradeoff?


I would be *very* interested in a plotting library for D. (Currently I 
output my data to text files, which I then process in Gnuplot.)

You've already mentioned line graphs. The other thing I use most are 3D 
plots, i.e. z as a function of x and y -- preferably with color/gradient 
mapping. In such plots one should be able to specify the viewpoint from 
which the graph is seen. A special case should be the top-down view, 
which is essentially a 2d plot where the z axis value is represented 
solely by color/brightness.

I think the functions should be able to work with both data sets and 
functions, i.e. both
     plot (real[] x, real[] y)
and
     plot (real function(real) f, real xLeft, real xRight)
should be available.

Regarding the API, I say keep it as simple as possible -- at least to 
begin with. I would love it if plotting my results could be done almost 
as simply as writefln'ing them. :)

-Lars



More information about the Digitalmars-d mailing list