Move the creation of plt.figure ouside scatter_x_against_y method.
This change was motivated by @FHusko's recent update in the colibre-pipeline (https://github.com/SWIFTSIM/pipeline-configs/pull/214). In that PR, many scripts repeat exactly the same calculations as those carried out by the scatter_x_against_y method. However, the scatter_x_against_y method in its current version cannot be simply imported and applied to Filip's plots because scatter_x_against_y creates its own (fig,ax) object.
This PR makes scatter_x_against_y create and apply the scatter to the (fig,ax) object passed by the user as an additional function's argument, instead of creating a new (fig,ax) object.
With this update, not only the scatter_x_against_y method becomes compatible with Filip's scripts, but also in general it should be better if the scatter_x_against_y method does only one action: plotting (instead of creating a figure and plotting).
Move the creation of plt.figure ouside
scatter_x_against_y
method.This change was motivated by @FHusko's recent update in the colibre-pipeline (https://github.com/SWIFTSIM/pipeline-configs/pull/214). In that PR, many scripts repeat exactly the same calculations as those carried out by the
scatter_x_against_y
method. However, thescatter_x_against_y
method in its current version cannot be simply imported and applied to Filip's plots becausescatter_x_against_y
creates its own(fig,ax)
object.This PR makes
scatter_x_against_y
create and apply the scatter to the(fig,ax)
object passed by the user as an additional function's argument, instead of creating a new(fig,ax)
object.With this update, not only the
scatter_x_against_y
method becomes compatible with Filip's scripts, but also in general it should be better if thescatter_x_against_y
method does only one action: plotting (instead of creating a figure and plotting).