Commit 6951ff7d authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Minor plotting improvements

parent c9d1bca8
......@@ -246,7 +246,7 @@ class GridSearch(BaseSearchClass):
add_mismatch=None, xN=None, yN=None, flat_keys=[],
rel_flat_idxs=[], flatten_method=np.max, title=None,
predicted_twoF=None, cm=None, cbarkwargs={}, x0=None, y0=None,
colorbar=False, xrescale=1, yrescale=1):
""" Plots a 2D grid of 2F values
......@@ -287,7 +287,8 @@ class GridSearch(BaseSearchClass):
if cm is None:
cm =
pax = ax.pcolormesh(X, Y, Z, cmap=cm, vmin=vmin, vmax=vmax)
pax = ax.pcolormesh(
X*xrescale, Y*yrescale, Z, cmap=cm, vmin=vmin, vmax=vmax)
if colorbar:
cb = plt.colorbar(pax, ax=ax, **cbarkwargs)
......@@ -295,8 +296,8 @@ class GridSearch(BaseSearchClass):
if add_mismatch:
self.add_mismatch_to_ax(ax, x, y, xkey, ykey, *add_mismatch)
ax.set_xlim(x[0], x[-1])
ax.set_ylim(y[0], y[-1])
ax.set_xlim(x[0]*xrescale, x[-1]*xrescale)
ax.set_ylim(y[0]*yrescale, y[-1]*yrescale)
if x0:
......@@ -884,7 +885,8 @@ class FrequencySlidingWindow(GridSearch):
self.input_data = np.array(input_data)
def plot_sliding_window(self, F0=None, ax=None, savefig=True,
colorbar=True, timestamps=False):
colorbar=True, timestamps=False,
F0rescale=1, **kwargs):
data =
if ax is None:
ax = plt.subplot()
......@@ -901,7 +903,7 @@ class FrequencySlidingWindow(GridSearch):
ax.set_ylabel('Frequency [Hz]')
twoF = twoF.reshape((len(tmids), len(frequencies)))
Y, X = np.meshgrid(frequencies, dts)
pax = ax.pcolormesh(X, Y, twoF)
pax = ax.pcolormesh(X, Y*F0rescale, twoF, **kwargs)
if colorbar:
cb = plt.colorbar(pax, ax=ax)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment