Plotinum: A plotting API for Go

1,893 views
Skip to first unread message

Ethan Burns

unread,
Jun 19, 2012, 5:59:18 PM6/19/12
to golan...@googlegroups.com
Hi Everyone,

I just finished some milestones in Plotinum, a plotting package that I have been writing for Go, and I wanted to tell the list about it.  Currently, it supports ploting lines, scatter plots, and box plots.  I plan to add support for bar charts, histograms, error bars, and possibly more, but I am working on it in my free time so progress may be slow.

The project is at https://code.google.com/p/plotinum.  It's still in early development, it's not well tested, and the API changes daily, but I would appreciate any feedback.

Best,
Ethan

Ian Davis

unread,
Jun 19, 2012, 6:16:28 PM6/19/12
to Ethan Burns, golan...@googlegroups.com
Very nice. I've been looking for something like this. I haven't had
much time to explore but I took one of the examples from the docs and
wrapped it up with the imports so it's a copy and paste example for
others. See https://gist.github.com/2956833

Looking forward to seeing how this develops and perhaps contributing a
little if I can.

> Best,
> Ethan

Ian

kortschak

unread,
Jun 19, 2012, 7:25:46 PM6/19/12
to golan...@googlegroups.com
Excellent. just what I've been looking for to convince some of my colleagues to move to Go.

Circles would be greatly appreciated - ala http://circos.ca/ (would be happy to contribute to this).

thanks
Dan

Dorival Pedroso

unread,
Jun 19, 2012, 9:03:51 PM6/19/12
to golan...@googlegroups.com
+1

平民四月份

unread,
Jun 20, 2012, 1:35:11 AM6/20/12
to golan...@googlegroups.com
+1
--
 Face the sea, for the spring flowers blossoming




Ethan Burns

unread,
Jun 20, 2012, 1:35:31 PM6/20/12
to golan...@googlegroups.com, Ethan Burns
On Tuesday, June 19, 2012 6:16:28 PM UTC-4, Ian Davis wrote:
Very nice. I've been looking for something like this. I haven't had
much time to explore but I took one of the examples from the docs and
wrapped it up with the imports so it's a copy and paste example for
others. See https://gist.github.com/2956833

Thanks!  I have already changed the API a bit so this example may not work anymore.  I will put a working example on the front project page.


Best,
Ethan

Ethan Burns

unread,
Jun 20, 2012, 1:46:36 PM6/20/12
to golan...@googlegroups.com
On Tuesday, June 19, 2012 7:25:46 PM UTC-4, kortschak wrote:
Excellent. just what I've been looking for to convince some of my colleagues to move to Go.

Circles would be greatly appreciated - ala http://circos.ca/ (would be happy to contribute to this).

Circles look really neat; they are certainly more radical than anything I had envisioned for Plotinum, which is designed for plotting things that have X and Y axes.  The Plotinum API allows you to implement your own custom Plotters, so you could theoretically implement a Plotter that draws one of these circles (at some point I will make a wiki page explaining how to make your own Plotter).  I don't see a big advantage to using Plotinum for these circles, however; since they don't have axes you can draw one to a vector graphics canvas directly instead.  Plotinum includes a package called vg for drawing vector graphics to both images and encapsulated PostScript (eventually it will support SVG via svgo and PDF via gopdf too) if you are interested in using that for drawing your circles.

If you do want to contribute something then I would be happy to take a look at patches.


Best,
Ethan

kortschak

unread,
Jun 21, 2012, 2:16:06 AM6/21/12
to golan...@googlegroups.com
The vg component looks like the right way to go - it has nearly all of what is required (beziers are used in circles show locus connections - it looks like Sonia's already put up a bezier implementation at rosetta code).

When work quietens down a little I'll put some stuff together. It would be nice if something like this could coalesce into a matplotlib-like library for Go.

Dan.

Ethan Burns

unread,
Jul 31, 2012, 8:50:03 AM7/31/12
to golan...@googlegroups.com
Hi again,

I wanted to announce that I just finished adding SVG support to Plotinum.  You can now output plots as .png, .eps, and .svg files.


Best,
Ethan

Peter A. Cejchan

unread,
Aug 1, 2012, 1:49:11 AM8/1/12
to golan...@googlegroups.com
Great project! Thanks!
Regards, Peter.

Brendan Tracey

unread,
May 4, 2013, 2:12:41 PM5/4/13
to golan...@googlegroups.com
I've been working on getting a good colored scatter working (like the matlab scatter), and it's mostly working. The other thing that I would like to have is a contour plot. Does anyone know of references to good ways to create a contour plot? It's different than a normal scatter because hypothetically you could have an infinite number of points. Is the right way to do this to choose a resolution and create a bunch of boxes?

John Nagle

unread,
May 4, 2013, 3:46:49 PM5/4/13
to golan...@googlegroups.com
There are many published algorithms.

Are you working from a function you can evaluate at any point, or
a set of data points which you must interpolate? Working from a
continuous, differentiable function isn't too hard. Turning
randomly spaced data points into clean contours is not well
defined.

One simple approach is to subdivide. Impose a grid on the
data and look at the points in each cell. If the Z range within
a cell is below a contour Z unit, that cell is more or less flat.
If not, subdivide the cell into 4 cells and recurse. Now
you have a quadtree of flat cells, each with a Z value.

John Nagle



Reply all
Reply to author
Forward
0 new messages