Skip to content

Commit

Permalink
Merge pull request #287 from alhom/plot_ionosphere_3.7.2
Browse files Browse the repository at this point in the history
Suppressed a redundant source of a warning, and began to raise an act…
  • Loading branch information
alhom authored Oct 2, 2024
2 parents ad5cdab + 915eb43 commit d14c90e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pyPlots/plot_ionosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,17 +616,19 @@ def make_circle(r):

# Adjust layout. Uses tight_layout() but in fact this ensures
# that long titles and tick labels are still within the plot area.
if axes is None:
plt.tight_layout(pad=0.01)
# if axes is None: # This causes a matplotlib warning, and the following "bbox_inches='tight'" should anyway do the same thing
# plt.tight_layout(pad=0.01)
savefig_pad=0.01
bbox_inches='tight'

# Save output or draw on-screen
if not draw and axes is None:
try:
plt.savefig(outputfile,dpi=300, bbox_inches=bbox_inches, pad_inches=savefig_pad)
except:
logging.info("Error attempting to save figure: " + str(sys.exc_info()))
except Exception as e:
print("Encountered the following exception from Matplotlib while trying to save a figure:")
print(e)
raise RuntimeError("Error attempting to save figure: " + str(sys.exc_info())+"\n\n There is a known issue with Matplotlib 3.7.2 here - if using that, try updating/reverting!")
logging.info(outputfile+"\n")
plt.close()
elif draw is not None and axes is None:
Expand Down

0 comments on commit d14c90e

Please sign in to comment.