Skip to content

Commit

Permalink
fix duplicate facecolor and edgecolor bug in plot_all_topologies()
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchin committed Aug 31, 2024
1 parent cbcce99 commit e9bcbcd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gplately/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,6 @@ def plot_plate_motion_vectors(
quiver = ax.quiver(X, Y, U, V, transform=self.base_projection, **kwargs)
return quiver


def plot_pole(self, ax, lon, lat, a95, **kwargs):
"""
Plot pole onto a matplotlib axes.
Expand All @@ -1441,7 +1440,6 @@ def plot_pole(self, ax, lon, lat, a95, **kwargs):
# Define the projection used to display the circle:
proj1 = ccrs.Orthographic(central_longitude=lon, central_latitude=lat)


def compute_radius(ortho, radius_degrees):
phi1 = lat + radius_degrees if lat <= 0 else lat - radius_degrees
_, y1 = ortho.transform_point(lon, phi1, ccrs.PlateCarree())
Expand All @@ -1450,7 +1448,9 @@ def compute_radius(ortho, radius_degrees):
r_ortho = compute_radius(proj1, a95)

# adding a patch
patch = ax.add_patch(mpatches.Circle(xy=[lon, lat], radius=r_ortho, transform=proj1, **kwargs))
patch = ax.add_patch(
mpatches.Circle(xy=[lon, lat], radius=r_ortho, transform=proj1, **kwargs)
)
return patch

@validate_reconstruction_time
Expand Down Expand Up @@ -1843,12 +1843,12 @@ def get_all_topologies(
@append_docstring(PLOT_DOCSTRING.format("topologies"))
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():
kwargs["edgecolor"] = color

return self._plot_feature(
ax,
self.get_all_topologies,
facecolor="none",
edgecolor=color,
**kwargs,
)

Expand Down

0 comments on commit e9bcbcd

Please sign in to comment.