Skip to content

Commit

Permalink
Set aspect ratio for density-temperature plots (#277)
Browse files Browse the repository at this point in the history
* Set aspect ratio for density-temperature plots

* Format

* Update other scripts

* One more
  • Loading branch information
robjmcgibbon authored Mar 27, 2024
1 parent c517e4e commit f7aa6a5
Show file tree
Hide file tree
Showing 21 changed files with 147 additions and 21 deletions.
8 changes: 7 additions & 1 deletion colibre/scripts/bh_masses.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ def setup_axes(mass_bounds, number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/birth_density_metallicity.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/birth_density_redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/birth_density_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/birth_metallicity_redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_internal_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_pressure.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_species_depletions.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,14 @@ def setup_axes(number_of_simulations: int, prop_type="hydro"):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_species_diffuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,14 @@ def setup_axes(number_of_simulations: int, prop_type="hydro"):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_species_interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,14 @@ def setup_axes(number_of_simulations: int, prop_type="hydro"):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_temperature_dust.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,14 @@ def setup_axes(number_of_simulations: int, prop_type="hydro"):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_temperature_dust2metal.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,14 @@ def setup_axes(number_of_simulations: int, prop_type="hydro"):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_temperature_dust_to_metals.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_temperature_metals.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_temperature_sf_fraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/density_temperature_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,14 @@ def setup_axes(number_of_simulations: int, prop_type="hydro"):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/gas_minimal_smoothing_length_redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/max_temperature_redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/median_temperature_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@
nlabel % number_of_simulations > 0
)

fig_w, fig_h = pl.figaspect(vertical_number / horizontal_number)
fig, ax = pl.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down
8 changes: 7 additions & 1 deletion colibre/scripts/particle_updates_step_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ def setup_axes(number_of_simulations: int):
# Ensure >= number_of_simulations plots in a grid
vertical_number = int(np.ceil(number_of_simulations / horizontal_number))

fig_w, fig_h = plt.figaspect(vertical_number / horizontal_number)
fig, ax = plt.subplots(
vertical_number, horizontal_number, squeeze=True, sharex=True, sharey=True
vertical_number,
horizontal_number,
squeeze=True,
sharex=True,
sharey=True,
figsize=(fig_w, fig_h),
)

ax = np.array([ax]) if number_of_simulations == 1 else ax
Expand Down

0 comments on commit f7aa6a5

Please sign in to comment.