Skip to content

Commit c8af3ce

Browse files
committed
added argument for maxcableSize to project.plot2d
-this is useful if you're using one legend for several array plots and want to ensure cable size color consistency
1 parent 92e7aeb commit c8af3ce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

famodel/project.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,7 @@ def plot2d(self, ax=None, plot_soil=False,
22072207
plot_landmask = kwargs.get('plot_landmask', False) # mask land areas
22082208
soil_alpha = kwargs.get('soil_alpha', 0.5)
22092209
max_line_depth = kwargs.get('max_line_depth', None) # max depth for line coloring if color_lineDepth is True
2210+
maxcableSize = kwargs.get('maxcableSize', None)
22102211
only_shared = kwargs.get('only_shared', False) # if color_lineDepth is True, only color shared lines
22112212
linewidth_multiplier = kwargs.get('linewidth_multiplier', 2) # multiplier for line widths if color_lineDepth is True
22122213
# if axes not passed in, make a new figure
@@ -2384,7 +2385,9 @@ def plot2d(self, ax=None, plot_soil=False,
23842385

23852386
# Plot cables one way or another (eventually might want to give Mooring a plot method)
23862387
if self.cableList and plot_cables:
2387-
maxcableSize = max([cab.dd['cables'][0].dd['A'] for cab in self.cableList.values()])
2388+
if maxcableSize == None:
2389+
maxcableSize = max([cab.dd['cables'][0].dd['A'] for cab in self.cableList.values()])
2390+
23882391
for cable in self.cableList.values():
23892392
# get cable color
23902393
import matplotlib.cm as cm

0 commit comments

Comments
 (0)