Tuesday, May 19, 2009

announcing cl-2d

Cl-2d is a two-dimensional graph library for Common Lisp. It builds on cl-cairo2 and thus uses the Cairo library, which provides various backends, including pixel-based (eg PNG, X11) and vector-based (PDF, SVG, PS) ones. It is meant solely for 2-dimensional plotting (hence the name). Cl-2d is available from Github. The license is LLGPL. Cl-2d is designed to be extensible instead of providing a plethora of "canned" functions - the latter of course exist, but the emphasis is on flexibility. Most plots used in scientific visualization are customized, and the purpose of this library is to make customization easy. Plotting happens on frames, which are rectangular areas. A DSL is available for splitting frames. A frame combined with a mapping from plot coordinates to Cairo coordinates is a drawing area. Functions named plot-* take a frame, set up and return a drawing area (on which you can continue drawing), while draw-* functions draw on an existing drawing area. This library is still under development, suggestions and contributions are welcome. I mean to clear up the axes code and add contour plots soon. See the example/ directory for a wide variety of examples. Some of the example plots, converted from PDF, are shown below.


  1. I was just about to create a page on cliki about cl-2d, but I see that some kind person has done it already. I am curious who it was :-)

  2. Tuesday 19 May 2009

    16:37 cl-2d : New page. -- Roland Kaufmann
    16:35 plotting : Added cl-2d. -- Roland Kaufmann

  3. That's just awesome. I have been looking for it for years! :)

  4. Tamas,

    I wanted to play around around with your package starting with the example-x11 file. I installed all needed packages and got everything loaded but I am missing the function 'interval-of'. Could you please tell me where this function is definied?

    Thanks a lot