Re: [Matplotlib-users] 2 x-axes

2011-09-12 Thread Neal Becker
Actually, though, I didn't want to plot 2 different sets of data as in that example, I want 1 set of data plotted with 2 different x-axis (different units). Any suggestion on modifying this example to accomplish this? import numpy as np import matplotlib.pyplot as plt from

Re: [Matplotlib-users] 2 x-axes

2011-09-12 Thread Neal Becker
Neal Becker wrote: Actually, though, I didn't want to plot 2 different sets of data as in that example, I want 1 set of data plotted with 2 different x-axis (different units). Any suggestion on modifying this example to accomplish this? import numpy as np import matplotlib.pyplot as plt

Re: [Matplotlib-users] 2 x-axes

2011-09-11 Thread Neal Becker
Gökhan Sever wrote: Hi, The code below should create a properly placed 2nd x-axis. You might need to adjust the placement of the figure canvas to match into the window. import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.parasite_axes import SubplotHost fig

Re: [Matplotlib-users] 2 x-axes

2011-09-11 Thread Jae-Joon Lee
Just in case, here is a version with axes_grid1 toolkit. Note that axes_grid is kind of deprecated. Regards, -JJ import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.axes_grid1 as axes_grid1 host = axes_grid1.host_subplot(111) hplt, = host.plot(np.random.rand(100)) from

Re: [Matplotlib-users] 2 x-axes

2011-09-11 Thread Jae-Joon Lee
On Sun, Sep 11, 2011 at 10:16 PM, Neal Becker ndbeck...@gmail.com wrote: Yes, that's very helpful.  Just one thing.  How would I get a bit more bottom margin on the main figure to leave more room for the extra axis? I'm using this as an example.  I experimented with plt.subplots_adjust, which

Re: [Matplotlib-users] 2 x-axes

2011-09-11 Thread Neal Becker
Jae-Joon Lee wrote: On Sun, Sep 11, 2011 at 10:16 PM, Neal Becker ndbeck...@gmail.com wrote: Yes, that's very helpful. Just one thing. How would I get a bit more bottom margin on the main figure to leave more room for the extra axis? I'm using this as an example. I experimented with

Re: [Matplotlib-users] 2 x-axes

2011-09-11 Thread Gökhan Sever
The master is here. JJ had showed me those multi axes tricks and he is back again with the plenty of changes to the axes_grid toolkit. The best thing to do is to make a new clone from the master repo and experiment. On Sun, Sep 11, 2011 at 1:37 PM, Neal Becker ndbeck...@gmail.com wrote:

[Matplotlib-users] 2 x-axes

2011-09-09 Thread Neal Becker
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

Re: [Matplotlib-users] 2 x-axes

2011-09-09 Thread Neal Becker
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

Re: [Matplotlib-users] 2 x-axes

2011-09-09 Thread Gökhan Sever
Hi, The code below should create a properly placed 2nd x-axis. You might need to adjust the placement of the figure canvas to match into the window. import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.parasite_axes import SubplotHost fig = plt.figure(figsize=(10,8))