[racket-dev] New plot library pushed

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Wed Oct 5 16:07:14 EDT 2011

On Wed, Oct 5, 2011 at 12:43 PM, Neil Toronto <neil.toronto at gmail.com> wrote:
> There aren't any porting docs, and that would be really helpful. So yes,
> please!
>
> These 'plot' doc pages are finished:
>  - PLoT: Graph Plotting (main page)
>  - Introduction
>  - 2D Plot Procedures
>  - 3D Plot Procedures
>  - Compatibility Module
>
> Reading over the finished pages should help you a lot.
>
> These have contracts and examples:
>  - 2D Renderers
>  - 3D Renderers
>
> These have only contracts (and occasional text and examples):
>  - Plot Utilities
>  - Plot and Renderer Parameters
>  - Plot Contracts
>
> FWIW, the contracts are a little wonky right now. I have a macro that
> generates defprocs and such. Apparently, a recent change to Scribble (or
> elsewhere) loses source location info, so they're badly formatted. Eli and I
> are working on it.
>
> For porting, there are two choices. One is to change (require plot) to
> (require plot/compat). I think that's covered pretty well in the docs
> already.
>
> The other is to keep (require plot). In that case, there are two main things
> to do:
>  - Change functions that return renderers:
>     mix -> list
>     line -> function, parametric or polar
>     contour -> contours
>     shade -> contour-intervals
>     surface -> surface3d
>  - Make sure plots have specified bounds
>
> The old plot would let you leave bounds out, and in that case they were
> [-5,5]. That can't consistently work with the new behavior, which is to have
> renderers communicate their bounds to 'plot' or 'plot3d'. So the default is
> now "no bounds".
>
> Here's an example: change
>
>  (plot (line sqr))
>
> to
>
>  (plot (function sqr -5 5))
>
> or
>
>  (plot (function sqr) #:x-min -5 #:x-max 5)
>
> I think that's enough to get started.

Looks like I spoke too quickly. I think I'm actually not going to be
much help with this.

In particular, I don't know what mix does and I can't figure out from
the docs, so I don't know what it means to replace 'mix' with 'list'.
I can try again if you want, but maybe it is easier for you if you
just do it. If not, I'm happy to help with whatever tasks you think
I'd be useful for.

Sorry,
Robby



Posted on the dev mailing list.