overlapping tick labels on plot consisting of several axis - tight_layout not working
<p>In a plot constructed by the code </p>

<pre><code>left, width = 0.1, 0.8
rect1 = [left, 0.7, width, 0.2]
rect2 = [left, 0.3, width, 0.4]
rect3 = [left, 0.1, width, 0.2]
fig = plt.figure(facecolor='white')
ax1 = fig.add_axes(rect1)
ax2 = fig.add_axes(rect2,sharex=ax1)
ax3 = fig.add_axes(rect3,sharex=ax1)
</code></pre>

<p>The max-y-tick-labels of the outer axis (x1,x2) overlap with the max-tick-labels of the inner plot (ax2) which is marked by the red eclipses in the following image:</p>

<p><a href="http://i.stack.imgur.com/EUnZQ.png" rel="nofollow"><img src="http://i.stack.imgur.com/EUnZQ.png" alt="enter image description here"></a></p>

<p>How can that be prevented, if </p>

<pre><code>plt.tight_layout() 
</code></pre>

<p>doesn't work?</p>

<p>By setting the y-labels manually, using </p>

<pre><code> ax1.set_yticks([30, 70])
</code></pre>

<p>the overlap can be prevented. </p>

<p>This solution is not completely satisfying however, since it is hardcoded and not very generic. But it works for this specific problem.</p>

<p>Another solution would be to move the y-labels of the middle axis to the right side, as suggested in </p>

<p><a href="http://stackoverflow.com/questions/10354397/python-matplotlib-y-axis-ticks-on-right-side-of-plot?rq=1">Python Matplotlib Y-Axis ticks on Right Side of Plot</a></p>

python matplotlib