1

I have been trying to plot a scatterplot matrix using the great example given by Joe Kington:

However, I would like to add xlabels and ylabels on the subplots where I have displayed ticks. When you change the positions of the ticks, the associated x/ylabel does not follow. I have not been able to find an option to change the location of the label; I was hoping to find something like ax.set_xlabel('XLabel',position='top') but it does not exist.

This is what I get finally,

enter image description here For example I would like X axis4 to be above the ticks.

Community
  • 1
  • 1
Viktor
  • 67
  • 1
  • 1
  • 6
  • Can you show us the _exact_ code you are using to generate that graph? Not having to guess what you are doing makes it easier to help;) – tacaswell Apr 25 '13 at 16:16

1 Answers1

1

If you want to change the x-label from bottom to top, or the y-label from left to right, you can (provided the specific suplot is called ax) do it by calling:

ax.xaxis.set_label_position('top')
ax.yaxis.set_label_position('right')

If you for example want the label "X label 2" to stay where it is but don't overlap the other subplot, you can try to add a

fig.tight_layout()

just before the fig.show().

Marius
  • 523
  • 4
  • 14