Skip to content

Commit

Permalink
make input more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindougherty-noaa committed Jul 20, 2023
1 parent 326b268 commit 7a142b7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/emcpy/plots/create_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def add_suptitle(self, text, **kwargs):
self.fig.suptitle(text, **kwargs)

def plot_logo(self, loc, which='noaa/nws',
single_logo=True, zoom=1, alpha=0.5):
subplot_orientation='last', zoom=1, alpha=0.5):
"""
Add branding logo on all axes.
"""
Expand All @@ -346,9 +346,17 @@ def plot_logo(self, loc, which='noaa/nws',
image_path = os.path.join(emcpy.emcpy_directory, 'logos', image_dict[which])
im = Image.open(image_path)

if subplot_orientation.lower() not in ['first', 'last', 'all']:
raise TypeError(f"{subplot_orientation} is not a valid input. " +
"Valid inputs include 'first', 'last', or 'all'")

ax_list = self.fig.axes

if single_logo:
if subplot_orientation.lower() == 'first':
ax = ax_list[0]
self._display_logo(ax, im, loc, zoom, alpha)

elif subplot_orientation.lower() == 'last':
ax = ax_list[-1]
self._display_logo(ax, im, loc, zoom, alpha)

Expand Down

0 comments on commit 7a142b7

Please sign in to comment.