## matplotlib-users

 [Matplotlib-users] normal x-y axes without a box From: David Pine - 2010-11-30 08:49:30 Attachments: test.png test1.png ```Is there a simple way to make a plot with axes that look like those in test1.png rather than like those in test.png? Here is the code that produced test.png. Thanks. Dave Pine import numpy as np import matplotlib.pyplot as plt t = np.linspace(0., 20., 100) y = np.sin(t) fig = plt.figure(1, figsize=(6,3) ) fig.subplots_adjust(bottom=0.2) ax = fig.add_subplot(1,1,1) ax.plot(t, y) ax.set_xlabel('t') ax.set_ylabel('y') plt.savefig('test.png') plt.show() ```
 Re: [Matplotlib-users] normal x-y axes without a box From: Benjamin Root - 2010-11-30 15:00:11 Attachments: Message as HTML ```On Tue, Nov 30, 2010 at 2:49 AM, David Pine wrote: > Is there a simple way to make a plot with axes that look like those in > test1.png rather than like those in test.png? Here is the code that > produced test.png. Thanks. > > Dave Pine > > import numpy as np > import matplotlib.pyplot as plt > > t = np.linspace(0., 20., 100) > y = np.sin(t) > > fig = plt.figure(1, figsize=(6,3) ) > fig.subplots_adjust(bottom=0.2) > > ax = fig.add_subplot(1,1,1) > ax.plot(t, y) > ax.set_xlabel('t') > ax.set_ylabel('y') > > plt.savefig('test.png') > > plt.show() > > > Dave, I believe that the axis spine feature is what you are looking for: http://matplotlib.sourceforge.net/users/whats_new.html#axis-spine-placement I hope that helps! Ben Root ```