VictorPozsgay / SuPerSim

SuPerSim (Summary for Permafrost Simulations) produces quick and easy visualization of permafrost metrics and time series from ensemble simulations
https://pypi.org/project/SuPerSim/
GNU General Public License v3.0
2 stars 0 forks source link

Return figures from plotting functions #4

Closed nicholas512 closed 4 months ago

nicholas512 commented 4 months ago

Its helpful to return figures from plotting functions, then its possible to edit the figure if necessary without changing the source code.

def plot_visible_skymap_from_horizon_file(hor_path):
    """ docstring """
    fig = plt.figure(figsize=(8, 8))
    # ... 
    plt.show()
    return fig    

then

fig = plot_visible_skymap_from_horizon_file(hor_path)
# add a title
fig.canvas.set_window_title('new title')