None of the contracts for any of the plot routines were a problem.<br><br>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. <br>
<br>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.<br>
<br><div class="gmail_quote">On Sun, Oct 9, 2011 at 2:27 PM, Neil Toronto <span dir="ltr"><<a href="mailto:neil.toronto@gmail.com">neil.toronto@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
That was quick!<div class="im"><br>
<br>
On 10/09/2011 01:10 PM, Doug Williams wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I ported all of the science collection graphics to use the new plot<br>
package. It was relatively painless. Most of the effort was actually in<br>
improving my graphics using some of the new options - like adding labels<br>
for legends. Also, there are many places with the old plot package where<br>
I had to fudge things like #:x-min and #x-max - like #:x-min 0.001<br>
instead of #:x-min 0.0 - because the graphics package itself was very<br>
unforgiving of it's internal numeric errors. Neil's seems to be much<br>
more robust and forgiving.<br>
</blockquote>
<br></div>
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.)<br>
<br>
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.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[Obviously I still need to do it in some<br>
cases where there would be contract violations on functions being plotted.]<br>
</blockquote>
<br></div>
Are the contract violations because some of PLoT's contracts are a little stricter? (I'm thinking specifically of 'points'.)<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Neil, thanks for the good work.<br>
</blockquote>
<br></div>
You're very welcome.<br>
<br>
Did you find the "Porting" page helpful?<br>
<br>
Neil T<br>
</blockquote></div><br>