Skip to content
Snippets Groups Projects
Commit 8f27fc99 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Add functionality to plot the mismatch in the grid search

parent c03b0a03
No related branches found
No related tags found
No related merge requests found
...@@ -1607,7 +1607,8 @@ class GridSearch(BaseSearchClass): ...@@ -1607,7 +1607,8 @@ class GridSearch(BaseSearchClass):
def plot_2D(self, xkey, ykey, ax=None, save=True, vmin=None, vmax=None, def plot_2D(self, xkey, ykey, ax=None, save=True, vmin=None, vmax=None,
add_mismatch=None, xN=None, yN=None, flat_keys=[], 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 """ Plots a 2D grid of 2F values
Parameters Parameters
...@@ -1636,7 +1637,15 @@ class GridSearch(BaseSearchClass): ...@@ -1636,7 +1637,15 @@ class GridSearch(BaseSearchClass):
if len(rel_flat_idxs) > 0: if len(rel_flat_idxs) > 0:
Z = flatten_method(Z, axis=tuple(rel_flat_idxs)) Z = flatten_method(Z, axis=tuple(rel_flat_idxs))
pax = ax.pcolormesh(X, Y, Z, cmap=plt.cm.viridis, vmin=vmin, vmax=vmax) if predicted_twoF:
Z = (predicted_twoF - Z) / (predicted_twoF + 4)
if cm is None:
cm = plt.cm.viridis_r
else:
if cm is None:
cm = plt.cm.viridis
pax = ax.pcolormesh(X, Y, Z, cmap=cm, vmin=vmin, vmax=vmax)
plt.colorbar(pax, ax=ax) plt.colorbar(pax, ax=ax)
if add_mismatch: if add_mismatch:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment