Python Matplotlib : Just the graph image
Question: I cannot get [pyplot](http://matplotlib.org/users/transforms_tutorial.html) to
produce "cropped" images, that is, get rid of the grey left and right borders,
as it is, it is not an accurate representation of the sound waveform : This
sound file has no silence before and after.

![enter image description here](http://i.stack.imgur.com/2L1zD.png)

My code :

    
    
    import gtk
    
    from matplotlib.figure import Figure
    from numpy import arange, sin, pi
    import scipy.io.wavfile as wavfile
    
    from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
    
        win = gtk.Window()
        win.connect("destroy", lambda x: gtk.main_quit())
        win.set_default_size(400,300)
        win.set_title("Cropping figure")
    
        rate, data = wavfile.read(open('/home/px/gare_du_nord-catchlak.wav', 'r'))
        f = Figure()
        a = f.add_subplot(111, axisbg=(0.1843, 0.3098, 0.3098))
        a.plot(range(len(data)),data, color="OrangeRed",  linewidth=0.5, linestyle="-")
        a.axis('off')
        a.autoscale_view('tight')
        canvas = FigureCanvas(f)  # a gtk.DrawingArea
    
        win.add(canvas)
    
        win.show_all()
        gtk.main()
    


Answer: OK, I got [my answer](http://stackoverflow.com/questions/8182124/how-do-i-
autosize-text-in-matplotlib-
python/8188287?noredirect=1#comment26699981_8188287) :

    
    
    f.subplots_adjust(0, 0, 1, 1)
    

