bendichter/brokenaxes

Different labelpad values in x and y labels

ruhugu opened this issue · 1 comments

I have found that I can only set different values of labelpad if I use set_ylabel before set_xlabel, If I do the opposite, the x's labelpad is set to the one of the y axis.

Looking at the code, it seems that the problem is in the definition of the set_ylabel method, in the line 308 of brokenaxes.py:

brokenaxes/brokenaxes.py

Lines 307 to 309 in bd293f4

def set_ylabel(self, label, labelpad=30, **kwargs):
self.big_ax.xaxis.labelpad = labelpad
return self.big_ax.set_ylabel(label, labelpad=labelpad, **kwargs)

I don't know if this a bug or it is intended for some reason. In any case, it can be bypassed by calling the method directly from big_ax.

@ruhugu thanks for tracking this down. From git blame, it looks like I added this line 4 years ago in the very first iteration of this project. I don't know what I was thinking 4 years ago! I'll remove it.