On 22 November 2010 19:01, Benjamin Root <ben.r...@ou.edu> wrote: > On Thu, Nov 18, 2010 at 8:58 AM, Scott Sinclair > <scott.sinclair...@gmail.com> wrote: >> >> It seems that the autofmt_xdate helper method is broken when twinx is >> used. >> >> The attached patch fixes it for me and still seems to give the >> advertised behaviour for single and vertically stacked subplots. > > I am not very familiar with this part of mpl, but your diff seems to cut out > a few things. In particular, the original code checks to see if the figure > has a single axes object or more. However, your code seems to cut this > check out. Now, it may have been that the check could have been > unnecessary, but I am not sure. I am curious as to your insight on this.
I'm not very familiar with the Matplotlib classes either, but I'll explain my reasoning. Anytime I create a figure with a single axes object the axes object has an is_last_row method which always returns True. I don't see much point in special casing, unless there's significant overhead that can be avoided by doing so? > In addition, the original code called "self.subplots_adjust(bottom=bottom)" > only when all subplots were on the last row. Now, it seems that it is > always called no matter what. The hasattr test is only checking that each axes object in the figure has an is_last_row method. In the current code all_subplots is always True unless the figure contains an axes object created with twinx or twiny (in which case the autofmt_xdate method does nothing useful - hence my patch). Cheers, Scott ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel