Skip to content
Snippets Groups Projects
Commit 0dee2e54 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Do not modify argument x of `plot_distr_funct`

Do not modify dummy argument x of `plot_distr_funct`.
parent 480800c9
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment