[Yt-dev] Colorbar handling

Matthew Turk matthewturk at gmail.com
Wed Sep 16 09:55:38 PDT 2009


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



More information about the yt-dev mailing list