[racket-dev] New plot library [Was: (to Jay) Re: What I'm working on]

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Aug 2 16:20:43 EDT 2011

An hour ago, Neil Toronto wrote:
> I'll write a backward-compatible wrapper for plot, so yes.
> Mostly. I'll try to emulate it as closely as possible, but any code
> that depends on the specific pixels or snip% class `plot' generates
> will probably break.
> I want plot2d and plot3d to be a little saner than plot. For
> example, currently, plot2d automatically shows the entirety of a
> parabolic curve; in contrast, plot only shows it in the area [-5,5]
> x [-5,5] unless you override it.

This replacement would be great -- it's pretty bad now that it goes
out to a(n outdated) C library with inferior graphic capabilities,
draws the graph into a temporary file which is then loaded back in
Racket.  If you have something that is "close enough" it should be
fine.  Doug Wiliams is probably the heaviest user of plot, so making
his code run is probably a good estimate for "close enough".  There
are also some tests in tests/plot that you can look into (they're
being compared directly to the png files in there, so they'd obviously
break, but should look similar).

Two more notes:

* IIRC, the only code that was considered as worth keeping is the
  curve fitting (and some other things around error estimations?) --
  it sounds like you have that part done better anyway.

* When you look at the current interface, bear in mind that it started
  with classes, but that was mostly an abuse to get something like
  keyword arguments.  Having just the plain keyworded interface should
  be fine now too, IMO.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.