Skip to content

Commit

Permalink
Update plot_fd.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry57 authored Oct 27, 2024
1 parent 0d1d462 commit 3ac7b79
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions GENetLib/plot_fd.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
'''Plot functional objects'''

def plot_fd(x, y = None, xlab = None, ylab = None):

fdobj = x
coef = fdobj['coefs']
coefd = coef.shape
Expand All @@ -27,23 +26,13 @@ def plot_fd(x, y = None, xlab = None, ylab = None):
fdmat = eval_fd(y, fdobj, 0)
rangey = [np.min(fdmat), np.max(fdmat)]
ylim = rangey
if ndim < 2:
plt.figure()
plt.plot(y, fdmat)
plt.axhline(0, linestyle='--', color='black')
plt.xlim(xlim)
plt.ylim(ylim)
plt.xlabel(xlab)
plt.ylabel(ylab)
plt.show()
elif ndim == 2:
plt.figure()
for irep in range(nrep):
plt.plot(y, fdmat[:, irep])
plt.axhline(0, linestyle='--', color='black')
plt.xlim(xlim)
plt.ylim(ylim)
plt.xlabel(xlab)
plt.ylabel(ylab)
plt.show()
plt.figure()
for irep in range(nrep):
plt.plot(y, fdmat[:, irep])
plt.axhline(0, linestyle='--', color='black')
plt.xlim(xlim)
plt.ylim(ylim)
plt.xlabel(xlab)
plt.ylabel(ylab)
plt.show()

0 comments on commit 3ac7b79

Please sign in to comment.