Re: [racket-dev] New plot library pushed

2011-10-09 Thread Neil Toronto

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
_
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] New plot library pushed

2011-10-09 Thread Doug Williams
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.toro...@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

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

[racket-dev] New plot library pushed

2011-10-05 Thread Neil Toronto

I've just pushed the new 'plot' library.

Eli and I both forgot that the new 'plot' still needs the old libfit, 
and removed it along with libplplot. I just added libfit back (the 
sources are in src/fit now instead of src/plot/fit) along with the 
proper configure, Makefile.in, and get-libs.rkt changes.


I can verify that libfit compiles on 64-bit Ubuntu. It *should* build on 
Windows and Mac. :D


I've taken Matthew's suggestion to make the new 'plot' as 
backward-compatible as possible. Plots might still break (such as the 
example at racket-lang.org and on the Wikipedia page). Using the 
'plot/compat' module should make these work.


This change replaces about 2 lines of C+support code with 7000 lines 
of Racket that does a lot more. Racket code for backward compatibility 
totals only 500 lines. The libfit library is about 500 lines of C+make code.


Neil T
_
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] New plot library pushed

2011-10-05 Thread Doug Williams
Does this mean it will it be in the next 'nightly' build?

On Wed, Oct 5, 2011 at 10:45 AM, Neil Toronto neil.toro...@gmail.comwrote:

 I've just pushed the new 'plot' library.

 Eli and I both forgot that the new 'plot' still needs the old libfit, and
 removed it along with libplplot. I just added libfit back (the sources are
 in src/fit now instead of src/plot/fit) along with the proper configure,
 Makefile.in, and get-libs.rkt changes.

 I can verify that libfit compiles on 64-bit Ubuntu. It *should* build on
 Windows and Mac. :D

 I've taken Matthew's suggestion to make the new 'plot' as
 backward-compatible as possible. Plots might still break (such as the
 example at racket-lang.org and on the Wikipedia page). Using the
 'plot/compat' module should make these work.

 This change replaces about 2 lines of C+support code with 7000 lines of
 Racket that does a lot more. Racket code for backward compatibility totals
 only 500 lines. The libfit library is about 500 lines of C+make code.

 Neil T
 __**___
  For list-related administrative tasks:
  
 http://lists.racket-lang.org/**listinfo/devhttp://lists.racket-lang.org/listinfo/dev

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev