First some setup code to follow along:
import numpy as np
import matplotlib.pyplot as plt
figure, (picture, intensity) = plt.subplots(nrows=2, figsize=(15, 3))
figure.set_dpi(80)
picture.imshow(np.random.uniform(size=(5, 50)))
intensity.plot(np.random.random(size=641))
Note the call to plt.subplots (the s at end is important; there's a different function without the s) requires matplotlib 1.1 or greater. But your original example setup works as well. Also note that the axis is scaled to 700 instead of 640 because matplotlib would prefer to draw a tick at 700 and figures the extra white space isn't such a big deal.
Edit: I just wanted to point out the figsize parameter, dpi setting, and picture axes have nothing to do with the original issue, but I added them to match the original example.
As Chris mentions, you can call
intensity.set_xlim((0, 640))
You can instead pass in a keyword argument to only tweak the desired parameter:
intensity.set_xlim(right=640)
If you know that you want tight axis limits, but don't want to set it manually, the axes object can figure it out based on the data that's been plotted.
intensity.autoscale(tight=True)
Or if you only want to scale the x-axis:
intensity.autoscale(axis='x', tight=True)
Note autoscale is special because it will readjust if your data limits change (e.g. if you plot another data set that has 680 points).
Alternatively, you can use the margins method:
intensity.margins(0)
This sets both x and y axis limits to the data limits and adds the specified padding---in this case, 0. If you actually want some spacing in the y-direction then you can write:
intensity.margins(0, 0.1)
which adds spacing equal to 10% of the y data-interval. These functions all do what you want, but their different call signatures (and behaviors) are useful in different situations.
Edit: fixed keyword argument to set_xlim based on Chris's suggestion.