On Tuesday 21 November 2006 22:09, Stephen George wrote:
> Thank you Pierre,
>
> I've taken a while to get around to it, but this code worked a treat,
> and taught me a little about how I can override things in matplotlib

Glad you found it useful.
playing some more about it, I realized that there could be some improvement 
with small values between 0.001 and 1: the following modifications should 
take care of that:

    def _set_orderOfMagnitude(self, mrange):
        """Sets the order of margnitude."""        
        locs = N.absolute(self.locs)
        if self.offset: 
            oom = math.floor(math.log10(mrange))
        else:
            if locs[0] > locs[-1]: 
                val = locs[0]
            else: 
                val = locs[-1]
            if val == 0: 
                oom = 0
            else: 
                oom = math.floor(math.log10(val))
        if oom <= -3:
            self.orderOfMagnitude = 3*(oom//3)
        elif oom <= -1:
            self.orderOfMagnitude = -3
        elif oom >= 4:
            self.orderOfMagnitude = 3*(oom//3)
        else:
            self.orderOfMagnitude = 0



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to