Units issue

There seems to be some confusion as to how the mpl unit system works, I hope the following will help to clarify that and keep this
thread focused on the issue.

Currently mpl provides an API via the 'ConversionInterface' class in 'matplotlb.units' that allows a user to define how to translate
their data into something meaningful for mpl to process (i.e. floats). If you are already passing around floats, then this
interface is not for you. This interface is for typed data that is to be plotted (i.e. it needs to be "manipulated" to convert it
to a float).

This manipulation is handled via the user-defined and registered ConversionInterface sub-class.

The idea is not that a user will do the following:

ax.plot( cms )
ax.plot( inches )

As that would imply that the user has already converted their data to floats. But that the user will this intead:

ax.plot( length_data1 )
ax.plot( length_data2 )

Where the length_dataX is some user-defined data type and a user-defined conversion class has been pre-registered. mpl will choose
the default units based upon what the user-defined conversion class says the default should be. But if a more explicit
specification is required, then the user does the following instead:

ax.plot( length_data1, xunits="cm" )
ax.plot( length_data2 )

This would plot the length data in centimeters. If desired then the user can do the following:

ax.xaxis.set_units( "cm" )

And the plot would be updated. The following also currently works:

ax.plot( length_data1, xunits="cm" )
ax.plot( length_data2, xunits="inches" )

And the final plot would be in inches. The current mpl interface for units is quite robust and supports a very generic interface
that is highly user-customizable (should the user want to do so). The interface is so robust that I defined a simple converter
class that will "convert" strings to floats. I use this with bar plots and do something like the following:

ax.bar( ["a", "b', "c"], [1, 2, 3] )

An example can be seen in the matplotlib 'test/mplTest/units/StrConverter.py' file. Additionally other unit example classes can be
found in the 'test/mplTest/units' directory.

The issue is, as John has already stated with the individual plot functions. 'ax.plot' works perfectly fine due to the way the line
data is cached and updated as needed (the updates take into account if units might have changed). Some individual plot functions
strip out the units then manipulate the data, and others keep the unitized data and pass it along to be stripped out later. The
issue is getting a consistent mechanism for dealing with where the conversion is to occur.

I think that John's proposal of having higher level classes that handle this (as well as the caching) might be the way to go. It
would allow the individual plot functions to stay simplistic and true to what they provide and let the data handle itself. This
type of mechanism promises to be faster since the data only needs to be converted once (in the typical use case). Overhead of
re-converting would only occur when the user explicitly changes the units for a specified axis. Additionally this approach looks to
be more appealing when it comes to making plottable data items that are selectable and ultimately manipulatable via a gui interface.

--James Evans