Skip to content

Commit

Permalink
explicitly set ec="none" for hexbin plots to avoid overlapping hexagons
Browse files Browse the repository at this point in the history
matpltolib's default is `ec="face" and lw=1` which can cause the appearance
of overlapping hexagons if the gridsize is large.
  • Loading branch information
raphaelquast committed Apr 3, 2024
1 parent acd7ce6 commit 2dda0fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions eomaps/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,14 @@ def radius_crs(self):
return "in"

Check warning on line 1127 in eomaps/shapes.py

View check run for this annotation

Codecov / codecov/patch

eomaps/shapes.py#L1127

Added line #L1127 was not covered by tests

def get_coll(self, x, y, crs, **kwargs):
# hide edgecolors if they are not explicitly set (to avoid overlapping
# hexagons due to large edge linewidths)
# matplotlib's default is currently `ec="face", lw=1`
if not any(i in kwargs for i in ("ec", "edgecolor")):
special_kwargs = {"ec": "none"}
else:
special_kwargs = {}

Check warning on line 1136 in eomaps/shapes.py

View check run for this annotation

Codecov / codecov/patch

eomaps/shapes.py#L1136

Added line #L1136 was not covered by tests

color_and_array = Shapes._get_colors_and_array(kwargs, None)

if isinstance(self._aggregator, str):
Expand All @@ -1149,6 +1157,7 @@ def get_coll(self, x, y, crs, **kwargs):
extent=kwargs.get("extent", extent),
**color_and_array,
**kwargs,
**special_kwargs,
)
return coll

Expand Down

0 comments on commit 2dda0fc

Please sign in to comment.