@@ -30,11 +30,10 @@ def plot_spectrum(S, ax=None):
3030 assert isinstance (S , pd .DataFrame ), 'S must be of type pd.DataFrame'
3131
3232 f = S .index
33-
34- ax = _xy_plot (f * 2 * np .pi , S / (2 * np .pi ), fmt = '-' , xlabel = 'omega [rad/s]' ,
33+ for key in S . keys ():
34+ ax = _xy_plot (f * 2 * np .pi , S [ key ] / (2 * np .pi ), fmt = '-' , xlabel = 'omega [rad/s]' ,
3535 ylabel = 'Spectral density [m$^2$s/rad]' , ax = ax )
3636
37-
3837 return ax
3938
4039
@@ -56,8 +55,9 @@ def plot_elevation_timeseries(eta, ax=None):
5655
5756 assert isinstance (eta , pd .DataFrame ), 'eta must be of type pd.DataFrame'
5857
59- ax = _xy_plot (eta .index , eta , fmt = '-' , xlabel = 'Time' ,
60- ylabel = '$\eta$ [m]' , ax = ax )
58+ for key in eta .keys ():
59+ ax = _xy_plot (eta .index , eta [key ], fmt = '-' , xlabel = 'Time' ,
60+ ylabel = '$\eta$ [m]' , ax = ax )
6161
6262 return ax
6363
@@ -531,12 +531,11 @@ def monthly_cumulative_distribution(J):
531531 for month in months :
532532 plt .semilogx (J .loc [cumSum [month ].index ], cumSum [month ].F , '--' ,
533533 label = calendar .month_abbr [month ])
534-
534+
535535 F = exceedance_probability (J )
536536 F .sort_values ('F' , inplace = True )
537- ax = plt .semilogx (J .loc [F .index ], 1 - F / 100 , 'k-' , fillstyle = 'none' , label = 'All' )
537+ ax = plt .semilogx (J .loc [F .index ], 1 - F [ 'F' ] / 100 , 'k-' , fillstyle = 'none' , label = 'All' )
538538
539- #plt.xlim([1000, 1E6])
540539 plt .grid ()
541540 plt .xlabel ('Energy Flux' )
542541 plt .ylabel ('Cumulative Distribution' )
0 commit comments