[Yt-dev] Colorbar handling

Sam Skillman 72Nova at gmail.com
Wed Sep 16 10:13:30 PDT 2009


I think this is definitely a good idea.  We have slowly been just
adding features on one by one and it definitely could use a revamp.
Much of this comes from the fact that colorbars are inherently nasty
things to work with (positioning, labeling, etc...).  I think the
features that we've built up comprise many of the options we want in
the end, but it should be done in a cleaner fashion.  Also, the
invalidation of colorbars and plots is definitely a good way to go.
This would eliminate having to do things like redraw_image when it
isn't necessary.

Cheers,
Sam

On Wed, Sep 16, 2009 at 10:55 AM, Matthew Turk <matthewturk at gmail.com> wrote:
> Hi guys,
>
> Devin, Sam and Adam Ginsburg have done a lot of really great work on
> the colorbar handling.  What I'd like to propose is that we take our
> existing gigantic routine and split it into a smaller handler function
> or class -- maybe something like RavenColorbar or YTColorbar.  I'm
> willing to do this, but before I do I wanted to clear it with
> everyone.  The way I am seeing it, the colorbar would be a wrapper
> around the matplotlib colorbar class, and it would handle some
> YT-specific stuff --
>
>  * Setting of datalabels, and knowing about units and so on
>  * Setting of ticks for the sometimes pathological situations in which
> we find ourselves
>  * Setting of ticks for the completely reasonable situations in which
> we also find ourselves
>  * Intelligently plotting into axes
>  * Notification handling (which is currently handled via a lambda for
> MPL 0.91.x compatibility I'd like to discard)
>
> What do you all think?  I think having this as a base would be easier
> for invalidation of colorbars, which is where we're moving.  The
> ultimate plan is to have a plot object and a colorbar object, and when
> certain actions are taken on either, one or both will be marked as
> "invalid" which would trigger a replot.  This would be things like
> resetting the width, changing the limits, etc etc.
>
> Thoughts?
>
> -Matt
> _______________________________________________
> Yt-dev mailing list
> Yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>



-- 
Samuel W. Skillman
DOE Computational Science Graduate Fellow
Center for Astrophysics and Space Astronomy
University of Colorado at Boulder
samuel.skillman[at]colorado.edu



More information about the yt-dev mailing list