diff --git a/figures/beacon/src/beacon_field.py b/figures/beacon/src/beacon_field.py index d09c7ed..523bbc1 100755 --- a/figures/beacon/src/beacon_field.py +++ b/figures/beacon/src/beacon_field.py @@ -53,6 +53,9 @@ def grid_plot(grid, ax=None, **plot_kwargs): if ax is None: ax = plt.gca() + if not grid: + return + x = [a.x for a in grid] y = [a.y for a in grid] l = [a.name for a in grid] @@ -127,7 +130,9 @@ def plot_field( scatter_kwargs = {**default_scatter_kwargs, **scatter_kwargs} - grid_plot([tx] + ants, ax=ax) + if tx or ants: + grid_plot([tx] + ants, ax=ax) + if ref_ant is not None: ax.set_title("Single baseline\n reference antenna={}, f={}MHz".format(ref_ant.name, f_beacon/1e6)) else: