Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update returns of figure annotations #611

Merged
merged 1 commit into from Nov 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 6 additions & 8 deletions metpy/plots/_util.py
Expand Up @@ -34,15 +34,14 @@ def add_timestamp(ax, time=None, x=0.99, y=-0.04, ha='right', **kwargs):

Returns
-------
ax : `matplotlib.axes.Axes`
The `Axes` instance used for plotting
`matplotlib.text.Text`
The `matplotlib.text.Text` instance created

"""
if not time:
time = datetime.utcnow()
timestr = datetime.strftime(time, 'Created: %Y-%m-%dT%H:%M:%SZ')
ax.text(x, y, timestr, ha=ha, transform=ax.transAxes, **kwargs)
return ax
return ax.text(x, y, timestr, ha=ha, transform=ax.transAxes, **kwargs)


def _add_logo(fig, x=10, y=25, zorder=100, which='metpy', size='small', **kwargs):
Expand All @@ -68,8 +67,8 @@ def _add_logo(fig, x=10, y=25, zorder=100, which='metpy', size='small', **kwargs

Returns
-------
fig : `matplotlib.figure`
The `figure` instance used for plotting
`matplotlib.image.FigureImage`
The `matplotlib.image.FigureImage` instance created

"""
fname_suffix = {'small': '_75x75.png',
Expand All @@ -83,8 +82,7 @@ def _add_logo(fig, x=10, y=25, zorder=100, which='metpy', size='small', **kwargs
raise ValueError('Unknown logo size or selection')

logo = imread(pkg_resources.resource_stream('metpy.plots', fpath))
fig.figimage(logo, x, y, zorder=zorder, **kwargs)
return fig
return fig.figimage(logo, x, y, zorder=zorder, **kwargs)


def add_metpy_logo(fig, x=10, y=25, zorder=100, size='small', **kwargs):
Expand Down