obspy/obspy — pull request #591 by bmorg (2013-06-28 14:43:38+00:00)
Title: Throw verbose exception if no data has been added before plotting

Trying to plot a PPSD() without adding data beforehand throws an exception that isn't necessarily self-explanatory:

```python
>>> ppsd = PPSD(stats, stats['paz'])
>>> ppsd.plot(fn)
Traceback (most recent call last):
File "", line 1, in
File "/[...]/obspy/signal/spectral_estimation.py", line 734, in plot
X, Y = np.meshgrid(self.xedges, self.yedges)
AttributeError: PPSD instance has no attribute 'xedges'
```

After applying this patch, the exception is slightly more helpful:

```python
>>> ppsd = PPSD(stats, stats['paz'])
>>> ppsd.plot(fn)
Traceback (most recent call last):
File "", line 1, in
File "/[...]/obspy/signal/spectral_estimation.py", line 737, in plot
raise Exception(msg)
Exception: No data to plot
```