In the following code I attempt to plot right and left
> yaxis labels each with its own color. The left axis comes
> out OK - red, medium The right axis comes out the default.
> I have tried everything I could think of (admittedly not
> much) to alter any property of the right labels and have
> had no success - How do I alter the right axis label
> properties in the example below??? thanks for any help.
Avoiding for now the question of what the proper interface should be
for accessing the left and right (or top and bottom) tick properties
in general, here's a quick fix that will give you access to all of the
tick labels for a give axis
In matplotlib.axis.py, replace the get_ticklabels method with
'Return a list of Text instances for ticklabels'
labels1 = [tick.label1 for tick in self.get_major_ticks() if tick.label1On]
labels2 = [tick.label2 for tick in self.get_major_ticks() if tick.label2On]
The current behavior was to just return the label1 instances (left for
xaxis, bottom for yaxis).
Perhaps the best solution is to add an optional arg to all the
labels = ax.get_xticklabels() # get all
labels = ax.get_xticklabels('left') # get left labels
labels = ax.get_xticklabels('right') # get right labels
and so on for get_xticks, get_xticklines and the y and set* analogs.