|
From: Paul H. <pmh...@gm...> - 2013-01-22 21:02:12
|
On Tue, Jan 22, 2013 at 12:22 PM, Jonathan Slavin
<js...@cf...>wrote:
> Hi,
>
> I'm having some trouble with using twiny and a title on the plot. The
> title is writing over the axis label -- and even the tick labels. I've
> tried tight_layout() but it doesn't seem to help. I could use fig.text
> instead of title and place the title text where I want it (with a bit of
> fiddling), but it'd be nice to have a more elegant solution.
>
Try this is a workaround:
fig, ax1 = plt.subplots()
ax2 = ax1.twiny()
ax1.plot(np.random.randn(50), 'gs')
ax2.plot(np.random.randn(50), 'bo')
ax1.set_title('Test Title')
ax2.xaxis.tick_bottom()
plt.show()
Does that help?
-paul
|