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.
According to the [documentation](https://docs.python.org/2/library/unittest.html?highlight=assertraises#unittest.TestCase.assertRaises), `assertRaises` accepts `*args`, which means `("x", "y")` is being passed as a unit, and not being unpacked. This results in the call `plot.plot(("x", "y"))`.