diff --git a/Inst_eddies/Analysis/distribution_function.py b/Inst_eddies/Analysis/distribution_function.py index 610891fc8c1ab4203548093560c57bceeac2faa6..4d3a4e771bae59a06acd4bcc16941dc90cfeba29 100755 --- a/Inst_eddies/Analysis/distribution_function.py +++ b/Inst_eddies/Analysis/distribution_function.py @@ -9,14 +9,14 @@ from os import path def plot_distr_funct(x, label = None, ax = None): """Sort and plot distribution function. x should be a Numpy array.""" - x.sort() + x_sorted = np.sort(x) nx = np.size(x) if nx != 0: if ax is None: fig, ax = plt.subplots() - ax.plot(x, (1 + np.arange(nx)) / nx, label = label) - print("minimum value:", x[0]) - print("maximum value:", x[-1]) + ax.plot(x_sorted, (1 + np.arange(nx)) / nx, label = label) + print("minimum value:", x_sorted[0]) + print("maximum value:", x_sorted[- 1]) print("number of values:", nx, "\n")