[racket-dev] New plot library pushed

From: Doug Williams (m.douglas.williams at gmail.com)
Date: Sun Oct 9 16:43:16 EDT 2011

None of the contracts for any of the plot routines were a problem.

I was talking about contracts on my own functions. For example, if I have a
function f(x) with a (>/c 0.0) contract, I still have to use #:x-min 0.001
(or something like it) instead of #:x-min 0.0 to avoid the contract error.
But, I would say that is the expected behavior.

Yes, the porting page was helpful. And really, the port was not hard at all.
The only thing that required much thought was getting the rectangles to work
for histograms. I incorrectly homed in on the word histogram. It might be
nice to provide a plain histogram renderer. But, it really wasn't hard after
I found rectangles. And thanks for writing the discrete-histogram, that was
very useful.

On Sun, Oct 9, 2011 at 2:27 PM, Neil Toronto <neil.toronto at gmail.com> wrote:

> That was quick!
> On 10/09/2011 01:10 PM, Doug Williams wrote:
>> I ported all of the science collection graphics to use the new plot
>> package. It was relatively painless. Most of the effort was actually in
>> improving my graphics using some of the new options - like adding labels
>> for legends. Also, there are many places with the old plot package where
>> I had to fudge things like #:x-min and #x-max - like #:x-min 0.001
>> instead of #:x-min 0.0 - because the graphics package itself was very
>> unforgiving of it's internal numeric errors. Neil's seems to be much
>> more robust and forgiving.
> I'll take credit for half of that. Internally, it treats any NaNs and INFs
> output from user functions as "holes" and handles them in a
> graphics-primitive-specific way. (E.g. polygons with at least one "hole"
> don't get drawn, lines get split.)
> The other half of the credit goes to Racket for giving me exact rationals
> to use for plot bounds and other internal quantities. It's been really nice
> to not have to worry about floating-point error.
>  [Obviously I still need to do it in some
>> cases where there would be contract violations on functions being
>> plotted.]
> Are the contract violations because some of PLoT's contracts are a little
> stricter? (I'm thinking specifically of 'points'.)
>  Neil, thanks for the good work.
> You're very welcome.
> Did you find the "Porting" page helpful?
> Neil T
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20111009/705a00d9/attachment.html>

Posted on the dev mailing list.