From: Pauli V. <pa...@ik...> - 2009-10-27 18:00:20
|
Hi, mpl_toolkit.axes_grid.AxesGrid uses a custom axes type as the default type of axes it creates. I think it might be more user-friendly to use matplotlib.axes.Axes as the default -- the functionality in basic use seems to be the same. The custom axes handle drawing ticks quite differently from matplotlib's usual Axes. I just spent an hour wondering why grid[0].xaxis.get_major_ticks()[-1].label.set_horizontalalignment("right") had no effect -- the answer is that LocatableAxis draws ticks using a custom tick artist, and that the correct axis object is in grid[0].axes["bottom"]. And in fact, it cannot adjust the align of individual tick labels. The AxesGrid is really useful, so I'd suggest the following change: --- lib/mpl_toolkits/axes_grid/axes_grid.py.orig 2009-10-27 19:51:43.000000000 +0200 +++ lib/mpl_toolkits/axes_grid/axes_grid.py 2009-10-27 19:52:13.000000000 +0200 @@ -210,10 +210,10 @@ if axes_class is None: - axes_class = LocatableAxes + axes_class = maxes.Axes axes_class_args = {} else: - if isinstance(axes_class, maxes.Axes): + if issubclass(axes_class, maxes.Axes): axes_class_args = {} else: axes_class, axes_class_args = axes_class -- Pauli Virtanen |