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

Create figure in `plot_distr_funct` if ax is None

Create a new figure in function `plot_distr_funct` if ax is None.
parent f9d7ac3e
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ def plot_distr_funct(x, label = None, ax = None): ...@@ -13,7 +13,7 @@ def plot_distr_funct(x, label = None, ax = None):
nx = np.size(x) nx = np.size(x)
if nx != 0: if nx != 0:
if ax is None: ax = plt.gca() if ax is None: fig, ax = plt.subplots()
ax.plot(x, (1 + np.arange(nx)) / nx, label = label) ax.plot(x, (1 + np.arange(nx)) / nx, label = label)
print("minimum value:", x[0]) print("minimum value:", x[0])
print("maximum value:", x[-1]) print("maximum value:", x[-1])
......
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