@@ -2449,19 +2449,60 @@ def plot2d(self, ax=None, plot_seabed=False, plot_soil=False,
24492449
24502450 def plot3d (self , ax = None , figsize = (10 ,8 ), plot_fowt = False , save = False ,
24512451 plot_boundary = True , plot_boundary_on_bath = True , args_bath = {},
2452- plot_axes = True , plot_bathymetry = True , plot_soil = False ,
2452+ plot_axes = True , plot_bathymetry = True , plot_soil = False , color = None ,
24532453 colorbar = True , boundary_only = False ,** kwargs ):
24542454 '''Plot aspects of the Project object in matplotlib in 3D.
24552455
24562456 TODO - harmonize a lot of the seabed stuff with MoorPy System.plot...
24572457
24582458 Parameters
24592459 ----------
2460- ...
2460+ ax : matplotlib.axes._subplots.Axes3DSubplot, optional
2461+ The 3D axes object to plot on. If None, a new figure and axes will be created.
2462+
2463+ figsize : tuple, optional
2464+ The size of the figure in inches, specified as (width, height). Default is (10, 8).
2465+
2466+ plot_fowt : bool, optional
2467+ Whether to plot the floating offshore wind turbine (FOWT) in the 3D visualization. Default is False.
2468+
2469+ save : bool, optional
2470+ Whether to save the plot to a file. Default is False.
2471+
2472+ plot_boundary : bool, optional
2473+ Whether to plot the project boundary in the 3D visualization. Default is True.
2474+
2475+ plot_boundary_on_bath : bool, optional
2476+ Whether to overlay the project boundary on the bathymetry plot. Default is True.
2477+
2478+ args_bath : dict, optional
2479+ Additional arguments to customize the bathymetry plot, such as contour levels or color maps. Default is an empty dictionary.
2480+
2481+ plot_axes : bool, optional
2482+ Whether to display the 3D axes in the plot. Default is True.
2483+
2484+ plot_bathymetry : bool, optional
2485+ Whether to include the bathymetry (seabed depth) in the 3D visualization. Default is True.
2486+
2487+ plot_soil : bool, optional
2488+ Whether to include soil properties or layers in the 3D visualization. Default is False.
2489+
2490+ color : str or matplotlib color, optional
2491+ The color to use for certain plot elements (lines and raft members - maybe cable too?). If None, default colors will be used. Default is None.
2492+
2493+ colorbar : bool, optional
2494+ Whether to include a colorbar in the plot (e.g., for bathymetry). Default is True.
2495+
2496+ boundary_only : bool, optional
2497+ If True, only the project boundary will be plotted, ignoring other elements. Default is False.
2498+
2499+ **kwargs : dict, optional
2500+ Additional keyword arguments passed to the underlying matplotlib plotting functions.
24612501
24622502 Returns
24632503 -------
2464- ax : figure axes
2504+ ax : matplotlib.axes._subplots.Axes3DSubplot
2505+ The 3D axes object containing the plot.
24652506 '''
24662507
24672508 # color map for soil plotting
@@ -2640,14 +2681,17 @@ def plot3d(self, ax=None, figsize=(10,8), plot_fowt=False, save=False,
26402681 #mooring.subsystem.plot(ax = ax, draw_seabed=False)
26412682 if mooring .ss :
26422683 for line in mooring .ss .lineList :
2643- if 'chain' in line .type ['material' ]:
2644- line .color = 'k'
2645- elif 'polyester' in line .type ['material' ]:
2646- line .color = [.3 ,.5 ,.5 ]
2684+ if color : # overwrite if color is given.
2685+ line .color = color
26472686 else :
2648- line .color = [0.5 ,0.5 ,0.5 ]
2687+ if 'chain' in line .type ['material' ]:
2688+ line .color = 'k'
2689+ elif 'polyester' in line .type ['material' ]:
2690+ line .color = [.3 ,.5 ,.5 ]
2691+ else :
2692+ line .color = [0.5 ,0.5 ,0.5 ]
26492693 line .lw = lw
2650- mooring .ss .drawLine (0 , ax , color = 'self' )
2694+ mooring .ss .drawLine (0 , ax , color = color )
26512695 elif mooring .parallels :
26522696 for i in mooring .i_sec :
26532697 sec = mooring .getSubcomponent (i )
@@ -2665,7 +2709,7 @@ def plot3d(self, ax=None, figsize=(10,8), plot_fowt=False, save=False,
26652709 # plot the FOWTs using a RAFT FOWT if one is passed in (TEMPORARY)
26662710 if plot_fowt :
26672711 for pf in self .array .fowtList :
2668- pf .plot (ax ,zorder = 6 ,plot_ms = False , axes_around_fowt = False )
2712+ pf .plot (ax , color = color , zorder = 6 ,plot_ms = False , axes_around_fowt = False )
26692713 # for i in range(self.nt):
26702714 # xy = self.turb_coords[i,:]
26712715 # fowt.setPosition([xy[0], xy[1], 0,0,0,0])
0 commit comments