Skip to content

Commit

Permalink
fix visibility of display_voronoi=True when dark_mode=True
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Apr 16, 2024
1 parent 4e84000 commit ef365fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions centerline_width/plotDiagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ def plotCenterlineBackend(
for k, v in centerline_coordinates_by_type:
x.append(k)
y.append(v)
# Plot labels for each point
#display_labels = True
#if display_labels:
# ax.annotate(f"{k}, {v}", (k, v), fontsize=8)
plt.scatter(x,
y,
c=centerline_color,
Expand Down Expand Up @@ -199,15 +203,19 @@ def plotCenterline(river_object: centerline_width.riverCenterline = None,

# Display the Voronoi Diagram
if display_voronoi:
voronoi_line_color = 'black'
if dark_mode: voronoi_line_color = 'moccasin'
if coordinate_unit == "Decimal Degrees":
voronoi_plot_2d(river_object.bank_voronoi,
show_points=True,
point_size=1,
line_colors=voronoi_line_color,
ax=ax)
if coordinate_unit == "Relative Distance":
voronoi_plot_2d(river_object.bank_voronoi_relative,
show_points=True,
point_size=1,
line_colors=voronoi_line_color,
ax=ax)

# Plot all possible paths with text for positions
Expand Down
8 changes: 4 additions & 4 deletions river_centerline_width_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
coord_type = "decimal degrees"
center_type = "VorOnoi"

river.saveCenterlineCSV(save_to_csv="centerline_for_csv.csv",
centerline_type=center_type,
coordinate_unit=coord_type)
#river.saveCenterlineCSV(save_to_csv="centerline_for_csv.csv",
# centerline_type=center_type,
# coordinate_unit=coord_type)
#river.saveCenterlineMAT(save_to_mat="centerline_for_matlab.mat", centerline_type=center_type, coordinate_unit=coord_type)
#river.saveCenterlineCSV(save_to_csv="centerline_for_csv.csv", latitude_header="lat", longitude_header="long", centerline_type="Equal Distance")
#river.saveCenterlineMAT(save_to_mat="centerline_for_matlab.mat", latitude_header="lat", longitude_header="long", centerline_type="Evenly Spaced")
Expand All @@ -84,7 +84,7 @@
show_plot=True,
coordinate_unit=coord_type)

transect = 2
transect = 5
slope_type = "average"

# Plot river bank width line
Expand Down

0 comments on commit ef365fc

Please sign in to comment.