Commit cf9a0702 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Forces user to specify idxs for flattening

This is not ideal, it would be better to calculate the idxs for the
keys, but I don't see an easy to way to do it at the momemt.
parent 7e840a97
......@@ -1599,8 +1599,8 @@ class GridSearch(BaseSearchClass):
fig.savefig('{}/{}_1D.png'.format(self.outdir, self.label))
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):
""" Plots a 2D grid of 2F values
......@@ -1626,8 +1626,8 @@ class GridSearch(BaseSearchClass):
shape = [len(x), len(y)] + [len(v) for v in flat_vals]
Z = z.reshape(shape)
while Z.ndim > 2:
Z = flatten_method(Z, axis=-1)
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)
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