Commit 8f27fc99 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Add functionality to plot the mismatch in the grid search

parent c03b0a03
......@@ -1607,7 +1607,8 @@ class GridSearch(BaseSearchClass):
def plot_2D(self, xkey, ykey, ax=None, save=True, vmin=None, vmax=None,
add_mismatch=None, xN=None, yN=None, flat_keys=[],
rel_flat_idxs=[], flatten_method=np.max):
rel_flat_idxs=[], flatten_method=np.max,
predicted_twoF=None, cm=None):
""" Plots a 2D grid of 2F values
......@@ -1636,7 +1637,15 @@ class GridSearch(BaseSearchClass):
if len(rel_flat_idxs) > 0:
Z = flatten_method(Z, axis=tuple(rel_flat_idxs))
pax = ax.pcolormesh(X, Y, Z,, vmin=vmin, vmax=vmax)
if predicted_twoF:
Z = (predicted_twoF - Z) / (predicted_twoF + 4)
if cm is None:
cm =
if cm is None:
cm =
pax = ax.pcolormesh(X, Y, Z, cmap=cm, vmin=vmin, vmax=vmax)
plt.colorbar(pax, ax=ax)
if add_mismatch:
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