Skip to content

Commit

Permalink
fill plate polygons with random colors in test_plot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchin committed Dec 23, 2024
1 parent ece4c2d commit f4b97d7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests-dir/unittest/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# test the plot function with the new PlateModel class

# MODEL_NAME = "Clennett2020"
# MODEL_NAME = "Muller2019"
MODEL_NAME = "merdith2021"
MODEL_NAME = "Muller2019"
# MODEL_NAME = "merdith2021"


def main(show=True):
Expand Down Expand Up @@ -56,7 +56,7 @@ def main(show=True):
"ridges": 0,
"all_topologies": 0,
"all_topological_sections": 0,
"plate_polygon_by_id": 0,
"plate_polygon_by_id": 1,
"unclassified_features": 0,
"slab_edges": 0,
"passive_continental_boundaries": 0,
Expand All @@ -71,7 +71,7 @@ def main(show=True):
"faults": 0,
"continental_rifts": 0,
"misc_boundaries": 0,
"transforms": 1,
"transforms": 0,
"continents": 0,
"topological_plate_boundaries": 0,
}
Expand All @@ -97,11 +97,12 @@ def main(show=True):
ids = set([f.get_reconstruction_plate_id() for f in gplot.topologies])
for id in ids:
if all_flag or plot_flag["plate_polygon_by_id"]:
color = list(np.random.choice(range(256), size=3) / 256)
gplot.plot_plate_polygon_by_id(
ax,
id,
facecolor="None",
edgecolor=list(np.random.choice(range(256), size=3) / 256),
facecolor=color + [0.5],
edgecolor=color,
)
plt.title(f"{age} Ma")

Expand Down

0 comments on commit f4b97d7

Please sign in to comment.