Nonlinear twin axis

I'm trying to make a plot that has two x-axis with one of them
nonlinear - twiny() is working great, but I'm hung up on how to get
the second axis to be spaced properly. For the sake of example, lets
say the first axis is linear on [1,2] - if I just plot data according
to that x-axis, all is fine. Now, I also want to see an x-axis on the
top that corresponds to, say x2 = x1^3 - then the second axis should
be on the range [1,8] . The problem is, it's not a linear mapping
from x1 to x2, so I can't just set the xlims on the second axis to 1
and 8 and have it work. I tried making a derived class of Scale (see
code below) using the appropriate transform, but it didn't seem to
have any effect on the axes. Do I need to do soemthing else with the
locators or formatters or something?

                class Cubedscale(scale.ScaleBase):
                    class CubedTransform(transforms.Transform):

                            def transform(self,values):
                                return values**3

                            def __init__(self):


                    def __init__(self, axis, **kwargs):
                    def get_transform(self):
                        return trans

                    def set_default_locators_and_formatters(self,axis):