@@ -128,48 +128,52 @@ def plot_matrix(
128128
129129def plot_chakrabarti (H , lambda_w , D , ax = None ):
130130 """
131- Plots, in the style of Chakrabart (2005), relative importance of viscous,
131+ Plots, in the style of Chakrabarti (2005), relative importance of viscous,
132132 inertia, and diffraction phemonena
133133 Chakrabarti, Subrata. Handbook of Offshore Engineering (2-volume set).
134134 Elsevier, 2005.
135135
136- Parameters
137- ----------
138- H: float or numpy array or pandas Series
139- Wave height [m]
140- lambda_w: float or numpy array or pandas Series
141- Wave length [m]
142- D: float or numpy array or pandas Series
143- Characteristic length [m]
144- ax : matplotlib axes object (optional)
145- Axes for plotting. If None, then a new figure is created.
146-
147- Returns
148- -------
149- ax : matplotlib pyplot axes
136+ Examples:
150137
151- Examples
152- --------
153138 **Using floats**
139+
154140 >>> plt.figure()
155141 >>> D = 5
156142 >>> H = 8
157143 >>> lambda_w = 200
158144 >>> wave.graphics.plot_chakrabarti(H, lambda_w, D)
145+
159146 **Using numpy array**
147+
160148 >>> plt.figure()
161149 >>> D = np.linspace(5,15,5)
162150 >>> H = 8*np.ones_like(D)
163151 >>> lambda_w = 200*np.ones_like(D)
164152 >>> wave.graphics.plot_chakrabarti(H, lambda_w, D)
153+
165154 **Using pandas DataFrame**
155+
166156 >>> plt.figure()
167157 >>> D = np.linspace(5,15,5)
168158 >>> H = 8*np.ones_like(D)
169159 >>> lambda_w = 200*np.ones_like(D)
170- >>> df = pd.DataFrame([H.flatten(),lambda_w.flatten(),D.flatten()], \
171- index=['H','lambda_w','D']).transpose()
160+ >>> df = pd.DataFrame([H.flatten(),lambda_w.flatten(),D.flatten()], index=['H','lambda_w','D']).transpose()
172161 >>> wave.graphics.plot_chakrabarti(df.H, df.lambda_w, df.D)
162+
163+ Parameters
164+ ----------
165+ H: float or numpy array or pandas Series
166+ Wave height [m]
167+ lambda_w: float or numpy array or pandas Series
168+ Wave length [m]
169+ D: float or numpy array or pandas Series
170+ Characteristic length [m]
171+ ax : matplotlib axes object (optional)
172+ Axes for plotting. If None, then a new figure is created.
173+
174+ Returns
175+ -------
176+ ax : matplotlib pyplot axes
173177 """
174178 assert isinstance (H , (np .ndarray , float , int , np .int64 ,pd .Series )), \
175179 'H must be a real numeric type'
@@ -305,6 +309,7 @@ def plot_environmental_contour(x1, x2, x1_contour, x2_contour, **kwargs):
305309 '''
306310 Plots an overlay of the x1 and x2 variables to the calculate
307311 environmental contours.
312+
308313 Parameters
309314 ----------
310315 x1: numpy array
@@ -331,6 +336,7 @@ def plot_environmental_contour(x1, x2, x1_contour, x2_contour, **kwargs):
331336 Default None.
332337 markers: string
333338 string or list of strings to use as marker types
339+
334340 Returns
335341 -------
336342 ax : matplotlib pyplot axes
0 commit comments