|
From: Neal B. <ndb...@gm...> - 2011-09-09 18:50:38
|
Neal Becker wrote:
> I have a semilog plot. I'd like to add a second x axis (maybe below the
> existing one, or else maybe on top of graph). This second x axis is simply
> describing the same existing data, in different units.
>
> For example imagine a plot of
>
> x - time in seconds
> y - velocity
>
> x2 - time in minutes
>
>
This almost works:
fig = plt.figure()
ax = fig.add_subplot(111)
...
ax2 = ax.twiny()
min_x, max_x = ax.get_xlim()
ax2.set_xlim (min_x-1, max_x-1)
except the 2nd x axis is on the top, and prints right on top of the title
|