[racket] Plot is voracious

From: Neil Toronto (neil.toronto at gmail.com)
Date: Wed May 21 17:53:05 EDT 2014

On 05/21/2014 12:45 PM, Jens Axel Søgaard wrote:
> 2014-05-21 17:37 GMT+02:00 Laurent <laurent.orseau at gmail.com>:
>> ... it eats everything! (particularly exceptions)
>> For example, it is perfectly happy with the following:
>>
>> % racket
>> Welcome to Racket v6.0.1.7.
>>> (require plot)
>>> (plot (function (lambda(x)(+ x n)))
>>    #:x-min 0 #:x-max 10 #:y-min 0 #:y-max 10)
>> (object:2d-plot-snip% ...)
>>
>> ... although n is clearly undefined. Presumably this is to avoid breaking on
>> math errors like `(/ 0)` ?
>
> Actually I think there need to be an add-on to plot that takes care of
> plotting functions with singularities. Currently the plot for (/ 1 x)
> in [-1;1] looks wrong.
>
> An attempt for such an add-on that uses plot as backend:
>
> https://github.com/soegaard/bracket/blob/master/plotting/adaptive-plotting.rkt

This is about the third item on my to-do list. Right now, I'm working on 
a standalone 3D engine in Typed Racket, which Plot will use for its 3D 
plots. I'm also strongly considering having Plot assemble picts for 2D 
plots instead of drawing them directly on a device context.

How function and surface renderers tell Plot what to draw is going to 
change. I'm holding off on adaptive sampling until I've finished 
monkeying with the plumbing.

Neil ⊥


Posted on the users mailing list.