Skip to content

Commit

Permalink
Merge pull request #543 from H-xie/fix-plot-sky
Browse files Browse the repository at this point in the history
Fix plot_sky
  • Loading branch information
bmorris3 authored Mar 15, 2023
2 parents fda8758 + c79ba4e commit f6fa9d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion astroplan/plots/sky.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ def plot_sky(target, observer, time, ax=None, style_kwargs=None,

# Set up axes & plot styles if needed.
if ax is None:
ax = plt.gcf().add_subplot(projection='polar')
if isinstance(plt.gca(), plt.PolarAxes):
ax = plt.gca()
else:
ax = plt.axes(polar=True)

if style_kwargs is None:
style_kwargs = {}
style_kwargs = dict(style_kwargs)
Expand Down

0 comments on commit f6fa9d2

Please sign in to comment.