I use the plot extensions to create new plots for histograms, etc. So, extensibility is important to us. We actually roll our own plots directly onto canvases for most of our day-to-day usage. As things get ready, I'd be happy to roll them into the science collection plots.<br>
<br>Doug<br><br><div class="gmail_quote">On Tue, Aug 2, 2011 at 11:33 AM, 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;">
Re-routing this email exchange to [racket-dev] for comments.<br>
<br>
Long story short: Jay roped me into replacing the current `plot' module by wrapping a plot library I was working on for my own use. (FWIW, I'm happy to finally contribute something!) Intended features:<br>
<br>
1. Doesn't depend on an FFI to libplplot<br>
2. Can automatically place plot area on functions and points<br>
3. Uses parameters for keyword argument default values<br>
4. Uses only dc<%> primitives / Is very pretty<br>
5. Is more flexible (when using the new plot2d and plot3d modules)<br>
<br>
Linux screenshots:<br>
<br>
<a href="http://students.cs.byu.edu/%7Entoronto/plot2d.png" target="_blank">http://students.cs.byu.edu/~<u></u>ntoronto/plot2d.png</a><br>
<a href="http://students.cs.byu.edu/%7Entoronto/plot3d.png" target="_blank">http://students.cs.byu.edu/~<u></u>ntoronto/plot3d.png</a><br>
<br>
The first shows off the almost-finished plot2d. It's as fast as the original `plot', and `shade' is twice as fast. Props to Matthew and Linux's foreign drawing libs for making it look so nice.<br>
<br>
The second shows off 3d-plot-area%, which wraps a dc<%> with 3d drawing primitives. The new plot3d will be 1.5x-2x slower, but the new features (e.g. compositing 3d plots, contours) should be worth it.<br>
<br>
I'll push code to github soon, and ask for volunteers to verify that it looks good on Mac and Windows.<br>
<br>
Specific questions<br>
------------------<br>
<br>
Matthew: It should look good on Mac and Windows if their drawing libs do subpixel-accurate, high-quality antialiasing. Do they?<br>
<br>
Doug and other heavy `plot' users: What can I add to plot2d and plot3d to make your life easier?<br>
<br>
Noel: Do you happen to have a kernel density estimator implementation that uses FFT or is otherwise more efficient than O(n^2)? Currently, (plot2d (density samples)) works, but is slow on large samples.<br>
<br>
Anyone: Are there any original `plot' features that should *not* be emulated in the new `plot' wrapper module?<br>
<br>
Anyone: Is it easy/possible to manipulate snip%s with, say, a click-and-drag? How about placing edit boxes on them? If it's not hard, I would like to make the 3d plots manipulatable after rendering.<br>
<br>
Neil T<br>
<br>
On 07/30/2011 02:01 PM, Jay McCarthy wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yup, so that old programs will keep working.<br>
<br>
Will you support the line fitting?<br>
<br>
Jay<br>
<br>
On Sat, Jul 30, 2011 at 1:56 PM, Neil Toronto<<a href="mailto:neil.toronto@gmail.com" target="_blank">neil.toronto@gmail.com</a><u></u>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sure can! Does "compatible source library" mean a bunch of wrappers for the<br>
functions "plot" currently exports?<br>
<br>
Neil<br>
<br>
On 07/30/2011 05:49 AM, Jay McCarthy wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Awesome. We've been wanting to throw it out for a long time. Can you<br>
make a compatible source library too... so we can replace it in the<br>
core?<br>
<br>
Jay<br>
<br>
On Fri, Jul 29, 2011 at 10:35 PM, Neil Toronto<<a href="mailto:neil.toronto@gmail.com" target="_blank">neil.toronto@gmail.com</a><u></u>><br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I've attached a screenshot of what I'm working on.<br>
<br>
It's a replacement for Racket's plot module. The plot module has these<br>
drawbacks:<br>
<br>
1. It's not smart enough to automatically size plots to the things -<br>
"renderers" - you're plotting. A renderer is only a function that accepts<br>
an<br>
image snip, so the plotter can't compute a rectangle that contains it.<br>
<br>
2. It depends on an external library, plplot.<br>
<br>
3. It draws ugly curves because plplot can't draw lines with<br>
subpixel-accurate endpoints. Also, plplot messes up antialiasing when the<br>
curves are made of too many lines. Whatever Racket uses doesn't have this<br>
problem, at least on Linux.<br>
<br>
4. It doesn't use parameters for things for which parameters make sense,<br>
like the size of the plots.<br>
<br>
I could probably alter the plot module for any one or two of these and<br>
submit patches. For all four, writing a replacement makes more sense.<br>
<br>
FWIW, this is related to my research. I've been using R to generate<br>
plots,<br>
but it's getting annoying to serialize samples in Racket and then<br>
unserialize them in R.<br>
<br>
Also, Bayesians make a LOT of plots. It's *really* nice to display them<br>
using image snips. That's very, very cool.<br>
<br>
This project feels vacation-y and relaxing. I figure it's because it<br>
doesn't<br>
require any more math than linear algebra. :D<br>
<br>
Neil<br>
</blockquote></blockquote></blockquote></blockquote>
______________________________<u></u>___________________<br>
For list-related administrative tasks:<br>
<a href="http://lists.racket-lang.org/listinfo/dev" target="_blank">http://lists.racket-lang.org/<u></u>listinfo/dev</a><br>
</blockquote></div><br>