<div>The following sample works well enough that I can do something similar for each of my current situational plotting needs However, I can't seem to get any of the keyword typings to work.</div><div><br></div><div>No keyword typing support for require/typed at this time, bug, or I'm flat out doing it wrong?</div>
<div><br></div><div>Thanks,</div><div><br>Ray</div><div><br></div><div>#lang typed/racket/base</div><div><br></div><div>(require</div><div> (only-in racket/math</div><div> sqr))</div><div><br></div><div>(define-type Color% (Class () () ()))</div>
<div><br></div><div>(define-type Plot-Pen-Style (U Integer</div><div> (U 'transparent 'solid</div><div> 'bdiagnol-hatch 'fdiagonal-hatch</div>
<div> 'horizontal-hath 'veritcal-hatch</div><div> 'crossdisg-hatch 'cross-hath)))</div><div> </div><div>(define-type Plot-Color (U Integer (List Real Real Real)</div>
<div> String Symbol Color%))</div><div><br></div><div>(define-type Image-Snip% (Class () () ()))</div><div><br></div><div>(require/typed plot/utils</div><div> [opaque Renderer2d renderer2d?]</div>
<div> [linear-seq (Real Real Exact-Nonnegative-Integer -> (Listof Real))])</div><div><br></div><div>(require/typed plot/main</div><div> [plot (Any -> Any)]</div><div> [function (case-> ((Real -> Real)</div>
<div> (Option Exact-Rational)</div><div> (Option Exact-Rational)</div><div> ;[#:y-min Exact-Rational]</div><div> ; [#:y-max Exact-Rational]</div>
<div> ; [#:samples Integer]</div><div> ; [#:color Plot-Color]</div><div> ; [#:width Natural]</div><div> ; [#:style Plot-Pen-Style]</div>
<div> ; [#:alpha Real]</div><div> ; [#:label (Option String)]</div><div> -> Renderer2d)</div><div> ((Real -> Real) -> Renderer2d))]</div>
<div> </div><div> [area-histogram </div><div> ((Real -> Real) (Listof Real) -> Renderer2d)])</div><div> </div><div>(define (test)</div><div> (: f (Real -> Real))</div><div> (define (f x) (exp (* -1/2 (sqr x))))</div>
<div> (plot (list (area-histogram f (linear-seq -4 4 10))</div><div> (function f -4 4))))</div>