diff --git a/gplately/plot.py b/gplately/plot.py index b50e1b9..d50b92d 100644 --- a/gplately/plot.py +++ b/gplately/plot.py @@ -291,6 +291,7 @@ class PlotTopologies(object): """ def __init__( + self.ridge_transforms = [] # hjt: Initialize ridge_transforms self, plate_reconstruction, coastlines=None, @@ -430,6 +431,10 @@ def _check_anchor_plate_id(id): return id def update_time(self, time): + self.ridge_transforms = [ + feature for feature in self.plate_reconstruction.topology_features + if feature.get_feature_type() == pygplates.FeatureType.gpml_transform + ] # hjt: Update ridge_transforms based on current topology features """Re-reconstruct features and topologies to the time specified by the `PlotTopologies` `time` attribute whenever it or the anchor plate is updated. @@ -1802,6 +1807,15 @@ def plot_unclassified_features(self, ax, color="black", **kwargs): @validate_reconstruction_time @append_docstring(GET_DATE_DOCSTRING.format("topologies")) +@validate_reconstruction_time +@append_docstring(GET_DATE_DOCSTRING.format("ridge transforms")) +def get_ridge_transforms(self, central_meridian=0.0, tessellate_degrees=None): + """Create a GeoDataFrame containing geometries of reconstructed ridge transforms.""" + return self.get_feature( + self.ridge_transforms, + central_meridian=central_meridian, + tessellate_degrees=tessellate_degrees, + ) # hjt: Added get_ridge_transforms method def get_all_topologies( self, central_meridian=0.0, @@ -1841,6 +1855,16 @@ def get_all_topologies( @validate_topology_availability("all topologies") @append_docstring(PLOT_DOCSTRING.format("topologies")) +@append_docstring(PLOT_DOCSTRING.format("ridge transforms")) +def plot_ridge_transforms(self, ax, color="black", **kwargs): + """Plot reconstructed ridge transforms onto a map.""" + return self.plot_feature( + ax, + self.ridge_transforms, + feature_name="ridge_transforms", + color=color, + **kwargs, + ) # hjt: Added plot_ridge_transforms method def plot_all_topologies(self, ax, color="black", **kwargs): """Plot topological polygons and networks on a standard map projection.""" if "edgecolor" not in kwargs.keys(): @@ -1959,4 +1983,4 @@ def plot_topological_plate_boundaries(self, ax, color="black", **kwargs): feature_name="topological plate boundaries", color=color, **kwargs, - ) + ) \ No newline at end of file