bladex.blade.Blade.plot¶
-
Blade.
plot
(elev=None, azim=None, ax=None, outfile=None)[source]¶ Plot the generated blade sections.
Parameters: - elev (int) – set the view elevation of the axes. This can be used to rotate the axes programatically. ‘elev’ stores the elevation angle in the z plane. If elev is None, then the initial value is used which was specified in the mplot3d.Axes3D constructor. Default value is None
- azim (int) – set the view azimuth angle of the axes. This can be used to rotate the axes programatically. ‘azim’ stores the azimuth angle in the x,y plane. If azim is None, then the initial value is used which was specified in the mplot3d.Axes3D constructor. Default value is None
- ax (matplotlib.axes) – allows to pass the instance of figure axes to the current plot. This is useful when the user needs to plot the coordinates of several blade objects on the same figure (see the example below). If nothing is passed then the method plots on a new figure axes. Default value is None
- outfile (string) – save the plot if a filename string is provided. Default value is None
EXAMPLE: Assume we already have the arrays radii, chord, pitch, rake, skew for 10 blade sections.
>>> sections_1 = np.asarray([blade.NacaProfile(digits='0012') for i in range(10)]) >>> blade_1 = blade.Blade(sections=sections, radii=radii, chord_lengths=chord, pitch=pitch, rake=rake, skew_angles=skew) >>> blade_1.apply_transformations()
>>> sections_2 = np.asarray([blade.NacaProfile(digits='0012') for i in range(10)]) >>> blade_2 = blade.Blade(sections=sections, radii=radii, chord_lengths=chord, pitch=pitch, rake=rake, skew_angles=skew) >>> blade_2.apply_transformations() >>> blade_2.rotate(rot_angle_deg=72)
>>> fig = plt.figure() >>> ax = fig.gca(projection=Axes3D.name) >>> blade_1.plot(ax=ax) >>> blade_2.plot(ax=ax)
On the other hand, if we need to plot for a single blade object, we can just ignore such parameter, and the method will internally create a new instance for the figure axes, i.e.
>>> sections = np.asarray([blade.NacaProfile(digits='0012') for i in range(10)]) >>> blade = blade.Blade(sections=sections, radii=radii, chord_lengths=chord, pitch=pitch, rake=rake, skew_angles=skew) >>> blade.apply_transformations() >>> blade.plot()