Suggestion(s) for twinx()

I was playing with twinx() a little tonight from the file and have a small suggestion. I think twinx() should call (before creating the new axes):


Currently, after calling twinx(), then new axis tick marks correctly appear on the right side of the plot. However, the major tick marks from the left hand side Y axis also appear on the right side of the plot which is a little confusing.

Also, since we have twinx(), it would be nice to have twiny():

def twiny(ax=None):
     Make a second axes overlay ax (or the current axes if ax is None)
     sharing the yaxis. The ticks for ax2 will be placed on the top,
     and the ax2 instance is returned. See examples/
     if ax is None:

     ax2 = gcf().add_axes(ax.get_position(), sharey=ax, frameon=False)

     return ax2

The case I'm thinking of where twiny() would would be useful is one that we hit a lot at work. Time is represented on the X axis and we want multiple label types. So we'd like to have the bottom axis be time in UTC and the upper axis to be PST or some other local time frame. I'm not sure whether or not it would be best to replot the data using twiny() or to try and set up a custom formatter on the second X scale since in my scenario there aren't two sets of data.