Fix UnboundLocalError when a datasource of the wrong shape is looked for

We should raise a proper exception when the shape isn't correct as opposed to let an UnboundLocalError occur.
Oh, you're right, but only if `assertRaises` took `("x", "y")` as a single argument. Try running the these examples as `plot.plot("x", "y")`. I think `assertRaises` expects a tuple of arguments, so you probably want to pass `(("x", "y"),)`.