Skip to content

Commit

Permalink
Small subsystem line plotting change to produce specific line section…
Browse files Browse the repository at this point in the history
… colors
  • Loading branch information
shousner committed Oct 30, 2024
1 parent 4dce27f commit 4d0fd2c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions moorpy/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,13 +434,13 @@ def drawLine(self, Time, ax, color="k", endpoints=False, shadow=True, colortensi

# color and width settings
if color == 'self':
color = line.color # attempt to allow custom colors
lw = line.lw
line.color = line.color # attempt to allow custom colors
line.lw = line.lw
elif color == None:
color = [0.3, 0.3, 0.3] # if no color, default to grey
lw = 1
line.color = [0.3, 0.3, 0.3] # if no color, default to grey
line.lw = 1
else:
lw = 1
line.lw = 1

# get the Line's local coordinates
Xs0, Ys0, Zs, tensions = line.getLineCoords(Time)
Expand All @@ -459,14 +459,14 @@ def drawLine(self, Time, ax, color="k", endpoints=False, shadow=True, colortensi
ax.plot(Xs[i:i+2], Ys[i:i+2], Zs[i:i+2], color=rgba, zorder=100)
else:
#linebit.append(ax.plot(Xs, Ys, Zs, color=color, lw=lw, zorder=100))
ax.plot(Xs, Ys, Zs, color=color, lw=lw, zorder=100)
ax.plot(Xs, Ys, Zs, color=line.color, lw=line.lw, zorder=100)

if shadow:
ax.plot(Xs, Ys, np.zeros_like(Xs)-self.depth, color=[0.5, 0.5, 0.5, 0.2], lw=lw, zorder = 1.5) # draw shadow
ax.plot(Xs, Ys, np.zeros_like(Xs)-self.depth, color=[0.5, 0.5, 0.5, 0.2], lw=line.lw, zorder = 1.5) # draw shadow

if endpoints == True:
#linebit.append(ax.scatter([Xs[0], Xs[-1]], [Ys[0], Ys[-1]], [Zs[0], Zs[-1]], color = color))
ax.scatter([Xs[0], Xs[-1]], [Ys[0], Ys[-1]], [Zs[0], Zs[-1]], color = color)
ax.scatter([Xs[0], Xs[-1]], [Ys[0], Ys[-1]], [Zs[0], Zs[-1]], color = line.color)


def setOffset(self, offset, z=0):
Expand Down

0 comments on commit 4d0fd2c

Please sign in to comment.