Skip to content

Commit

Permalink
Fix order of legend, so plot doesn't overlap (#92)
Browse files Browse the repository at this point in the history
* changed default order of plots to 4

* changed default order of barbs to 4.1

* added comments
  • Loading branch information
ESadek-MO committed Mar 17, 2023
1 parent 07c1866 commit 9387cd4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tephi/isopleths.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ def plot(self, barbs, **kwargs):
"""
self._gutter = kwargs.pop("gutter", _BARB_GUTTER)
self._kwargs = dict(length=7, zorder=10)
# zorder of 4.1 is higher than all MPL defaults, excluding legend. Also
# higher than tephi default for plot-lines.
self._kwargs = dict(length=7, zorder=4.1)
self._kwargs.update(kwargs)
self._custom_kwargs = dict(
color=None, linewidth=1.5, zorder=self._kwargs["zorder"]
Expand Down Expand Up @@ -444,8 +446,9 @@ def plot(self, **kwargs):
if self.line is not None and self.line in self.axes.lines:
self.axes.lines.remove(self.line)

# zorder of 4 is higher than all MPL defaults, excluding legend.
if "zorder" not in kwargs:
kwargs["zorder"] = 10
kwargs["zorder"] = 4

(self.line,) = self.axes.plot(
self.temperature, self.theta, transform=self._transform, **kwargs
Expand Down

0 comments on commit 9387cd4

Please sign in to comment.