diff --git a/plotting.py b/plotting.py index 6e83a8fb4ff0dfaba83f6eab36cbb839ed728ddc..f5793624aaa240d32e1313445485d7e8b2fa9bd6 100644 --- a/plotting.py +++ b/plotting.py @@ -223,7 +223,7 @@ def plot_hist_2D(plotname, xedges, yedges, hist, varx_label=None, vary_label=Non extraopts = dict() if log: - extraopts.update(norm=matplotlib.colors.LogNorm(vmin=1, vmax=np.max(hist))) + extraopts.update(norm=matplotlib.colors.LogNorm(vmin=np.min(hist[hist>0]), vmax=np.max(hist))) ax.set_facecolor("black") pcm = ax.pcolormesh(X, Y, hist, cmap="inferno", **extraopts) @@ -297,7 +297,7 @@ def plot_profile_2D(plotname, valsx, valsy, scores, hist = [] for binindex_x in range(1, len(xedges)+1): line = [] - for binindex_y in range(1, len(xedges)+1): + for binindex_y in range(1, len(yedges)+1): binindices_xy = (binindices_x == binindex_x) & (binindices_y == binindex_y) scores_bin = scores[binindices_xy] if len(scores_bin) > 0: @@ -310,6 +310,7 @@ def plot_profile_2D(plotname, valsx, valsy, scores, line.append(prof_score) hist.append(line) hist = np.array(hist) + hist = hist.T # had a list of columns - needs to be list of rows plot_hist_2D(plotname, xedges, yedges, hist, **kwargs) diff --git a/scripts/plot_single_neuron.py b/scripts/plot_single_neuron.py index bb638d8dd81b86f413a03bd6b2cfd272501a6a57..6f128199d8b11c4d4b86b1ce4aabf3127593b456 100755 --- a/scripts/plot_single_neuron.py +++ b/scripts/plot_single_neuron.py @@ -132,4 +132,5 @@ elif args.mode.startswith("hist"): ymin=vary_range[0], ymax=vary_range[1], nbinsy=vary_range[2], weights=weights, varx_label=varx_label, vary_label=vary_label, + log=args.log, )