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

Suppressed a redundant source of a warning, and began to raise an act… #287

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading