[1]:
import numpy as np
import os
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from astropy.table import Table, join
from astropy import units as u
from edge_pydb import EdgeTable

params = {'mathtext.default': 'regular' }
plt.rcParams.update(params)

Plotting Global Properties

This notebook gives a few examples of plotting the CSV tables that are found in the dat_glob subdirectory of edge_pydb. These tables provided galaxy-wide properties from CALIFA or CARMA and are hence referred to as “global”.

Plot CO observation parameters, a la Bolatto et al. (2017) Figure 4.

[2]:
coobs = EdgeTable('edge_coobs_DE.csv')
coobs
[2]:
EdgeTable length=126
NamecoVsyscoDEobstimcoNptcoDEbmajcoDEbmincoRMS_10coTpk_10coSNRpeak_10ImagingDate_10coRMS_20coTpk_20coSNRpeak_20ImagingDate_20
km / sharcsecarcsecmKmKmKmK
str13float64float64int64float64float64float64int64float64str21float64int64float64str21
ARP2205340.94.074.483.8741.8347283.0302/14/16 05:15:10 CST33.03461104.7506/09/16 07:03:55 CDT
IC04804492.93.9874.883.9353.681015.1102/15/16 16:09:31 CST42.379218.7306/08/16 10:40:35 CDT
IC05402056.63.3376.223.6465.93755.6902/12/16 17:08:14 CST51.23366.5706/08/16 10:49:37 CDT
IC09446843.04.0975.394.1741.63177.6402/12/16 17:25:13 CST32.52788.5406/08/16 10:59:27 CDT
IC11512159.92.6575.323.7877.23824.9402/12/16 17:40:21 CST60.13015.0206/08/16 11:07:49 CDT
IC11994663.03.9774.924.347.33517.4302/12/16 17:55:31 CST37.12667.1506/08/16 11:16:31 CDT
IC16834774.94.3474.963.7948.078516.3502/12/16 18:13:26 CST37.479421.2406/08/16 11:27:22 CDT
IC22474261.74.0174.793.8543.343810.1202/12/16 18:31:08 CST34.041612.2506/08/16 11:37:39 CDT
IC24874292.13.9976.173.945.63116.8402/12/16 18:47:00 CST35.63038.5106/08/16 11:46:48 CDT
IC45665479.54.0176.013.8941.32566.1902/12/16 19:02:27 CST32.42457.5406/08/16 11:55:34 CDT
IC53764951.04.0874.614.0751.12324.5402/12/16 19:16:54 CST40.51844.5406/08/16 12:04:00 CDT
NGC04444762.13.1475.034.157.52654.6102/12/16 19:32:20 CST45.72024.4306/08/16 12:12:45 CDT
NGC04475489.65.09134.523.6745.455612.2402/12/16 19:55:04 CST35.149514.1106/08/16 12:26:03 CDT
NGC04775751.44.3375.113.9350.53256.4402/12/16 20:17:28 CST39.52736.906/08/16 12:38:12 CDT
NGC04965893.83.9974.93.7646.53627.7802/12/16 20:33:39 CST36.23399.3606/08/16 12:47:41 CDT
NGC05234683.04.374.633.7758.564010.9302/12/16 20:50:59 CST43.857213.0806/08/16 12:57:29 CDT
NGC05284745.53.9974.923.9849.12475.0202/12/16 21:07:33 CST38.81864.7906/08/16 13:06:41 CDT
NGC05515113.33.9474.83.7946.13297.1202/12/16 21:23:38 CST35.72827.8906/08/16 13:15:46 CDT
NGC11674851.24.2974.83.6452.82815.3202/12/16 21:39:20 CST41.22225.3806/08/16 13:24:48 CDT
NGC22533542.03.9975.654.1545.867114.6502/12/16 21:57:48 CST36.161917.1606/08/16 13:35:06 CDT
NGC23474388.84.674.854.7940.345711.3502/12/16 22:14:45 CST31.241913.4306/08/16 13:44:45 CDT
NGC24104602.27.35134.924.0654.53446.302/12/16 22:37:42 CST42.92996.9706/08/16 13:58:11 CDT
NGC24802320.84.6675.164.0356.83886.8302/12/16 23:02:51 CST44.13658.2806/08/16 14:11:02 CDT
NGC24864569.71.374.63.8988.64515.0902/12/16 23:19:01 CST69.63294.7206/08/16 14:19:23 CDT
NGC24874758.94.6274.923.9260.84817.9102/12/16 23:34:50 CST47.84579.5706/08/16 14:28:23 CDT
NGC26235437.66.23145.183.8430.6114837.5802/13/16 00:08:46 CST23.8110946.506/08/16 14:47:52 CDT
NGC26393150.04.0175.374.0352.364712.3702/13/16 00:31:37 CST41.646311.1306/08/16 15:00:21 CDT
NGC27303795.14.3175.554.0648.42715.6102/13/16 00:46:25 CST37.42115.6306/08/16 15:08:43 CDT
..........................................
UGC042803469.74.0174.774.5156.82905.1102/13/16 21:11:01 CST43.72495.6806/09/16 02:33:24 CDT
UGC044614906.53.9974.884.2253.13767.0902/13/16 21:27:23 CST41.43528.5206/09/16 02:42:51 CDT
UGC051087913.43.9875.474.3836.12516.9702/13/16 21:43:33 CST27.52298.3406/09/16 02:52:17 CDT
UGC051116595.54.6175.214.9537.640310.702/13/16 22:00:36 CST29.437312.706/09/16 03:01:45 CDT
UGC052442981.72.3375.14.6459.12824.7802/13/16 22:15:19 CST46.52254.8306/09/16 03:10:13 CDT
UGC053598249.53.9976.754.8727.81505.4202/13/16 22:29:51 CST21.61255.7606/09/16 03:18:33 CDT
UGC05498NED016174.43.9375.243.9261.92734.4102/13/16 22:44:36 CST47.82505.2306/09/16 03:26:43 CDT
UGC055985519.82.9875.834.0754.63786.9302/13/16 23:00:24 CST43.03077.1406/09/16 03:35:37 CDT
UGC063126201.52.9474.614.5750.82244.402/13/16 23:15:55 CST39.51894.7806/09/16 03:43:53 CDT
UGC070123031.54.074.733.9254.93716.7402/13/16 23:32:41 CST42.72495.8306/09/16 03:52:51 CDT
UGC081078076.93.8874.874.4736.33048.3702/25/16 17:47:43 CST28.22729.6706/09/16 04:02:41 CDT
UGC082505184.04.0174.873.9149.42324.702/14/16 00:08:08 CST39.01664.2706/09/16 04:11:46 CDT
UGC082677078.64.2774.73.9250.94719.2602/14/16 00:25:41 CST39.744511.206/09/16 04:21:29 CDT
UGC090677645.84.0375.614.3947.44028.4802/14/16 00:40:55 CST36.13359.2706/09/16 04:30:12 CDT
UGC094763236.14.075.163.8958.13135.3902/14/16 00:56:11 CST45.22435.3906/09/16 04:38:44 CDT
UGC095378576.54.3674.613.9643.82525.7602/14/16 01:10:59 CST33.52236.6606/09/16 04:47:31 CDT
UGC095425386.63.9875.063.6153.13135.8902/14/16 01:26:49 CST41.02897.0406/09/16 04:56:27 CDT
UGC096652535.64.0174.573.7364.06079.4802/14/16 01:43:30 CST50.856411.0806/09/16 05:05:17 CDT
UGC097593408.43.9775.043.6754.065512.1302/14/16 02:00:47 CST42.162014.7306/09/16 05:14:47 CDT
UGC098735528.43.9874.733.751.63266.3202/14/16 02:16:51 CST40.22786.9106/09/16 05:23:40 CDT
UGC098925569.73.6774.844.1544.82154.8102/14/16 02:32:45 CST34.51945.606/09/16 05:32:06 CDT
UGC099193151.34.6674.824.4953.43286.1402/14/16 02:48:59 CST41.91984.7306/09/16 05:41:15 CDT
UGC100432153.24.2974.673.969.36148.8502/14/16 03:05:49 CST54.161011.2606/09/16 05:50:59 CDT
UGC101233720.04.0174.383.8857.663210.9802/14/16 03:24:22 CST43.758913.4606/09/16 06:01:25 CDT
UGC102056432.92.9675.574.1444.52325.2202/14/16 03:39:42 CST34.42136.1706/09/16 06:09:41 CDT
UGC103314485.43.0176.54.0865.32654.0602/14/16 03:55:49 CST49.21943.9406/09/16 06:17:50 CDT
UGC103808510.74.0174.824.3846.52375.102/14/16 04:10:49 CST35.92266.2806/09/16 06:26:18 CDT
UGC103844869.04.0175.154.0443.665715.0602/14/16 04:27:55 CST33.861218.0906/09/16 06:36:15 CDT
UGC107108153.94.0175.043.9550.53677.2802/14/16 04:42:31 CST38.42366.1606/09/16 06:44:41 CDT
[3]:
plt.figure(figsize=(12, 7))

ax1=plt.subplot(2,3,1)
plt.hist(coobs['coDEobstim'], bins=np.arange(0, 20, 1), ec='black')
plt.xlabel('Observing time [h]', labelpad=2, fontsize='large')
plt.ylabel('Number of galaxies', labelpad=2, fontsize='large')
ax1.text(0.95,0.88,'$\mu$ = %3.1f h' % np.mean(coobs['coDEobstim']),
    ha='right',transform=ax1.transAxes)

ax2=plt.subplot(2,3,2)
beam=np.sqrt(coobs['coDEbmaj']*coobs['coDEbmin'])
plt.hist(beam, bins=np.arange(3, 6.2, 0.2), ec='black')
plt.xlabel('Beam size [arcsec]', labelpad=2, fontsize='large')
tick_spacing = 1
ax2.xaxis.set_major_locator(ticker.MultipleLocator(tick_spacing))
ax2.text(0.95,0.88,'$\mu$ = %3.1f"' % np.mean(beam),
    ha='right', transform=ax2.transAxes)

ax3=plt.subplot(2,3,3)
plt.hist(coobs['coRMS_10'], bins=np.arange(20,100,5), ec='black')
plt.xlabel('10 km/s Sensitivity [mK]', labelpad=2, fontsize='large')
ax3.text(0.95,0.88,'$\mu$ = %4.1f mK' % np.mean(coobs['coRMS_10']),
    ha='right', transform=ax3.transAxes)

ax4=plt.subplot(2,3,4)
plt.hist(coobs['coRMS_20'], bins=np.arange(20,100,5), ec='black')
plt.xlabel('20 km/s Sensitivity [mK]', labelpad=2, fontsize='large')
plt.ylabel('Number of galaxies', labelpad=2, fontsize='large')
ax4.text(0.95,0.88,'$\mu$ = %4.1f mK' % np.mean(coobs['coRMS_20']),
    ha='right', transform=ax4.transAxes)

ax5=plt.subplot(2,3,5)
plt.hist(coobs['coTpk_20'], bins=np.logspace(2,4,num=20), ec='black')
plt.xlabel('20 km/s Peak Signal [mK]', labelpad=2, fontsize='large')
ax5.set_xscale("log")
ax5.text(0.95,0.88,'$\mu$ = %4.1f mK' % np.mean(coobs['coTpk_20']),
    ha='right', transform=ax5.transAxes)

ax6=plt.subplot(2,3,6)
plt.hist(coobs['coSNRpeak_20'], bins=np.logspace(0.5,2,num=20), ec='black')
plt.xlabel('Peak SNR', labelpad=2, fontsize='large')
ax6.set_xscale("log")
ax6.text(0.95,0.88,'$\mu$ = %4.1f' % np.mean(coobs['coSNRpeak_20']),
    ha='right', transform=ax6.transAxes)

plt.subplots_adjust(hspace=0.25)
plt.show()
_images/global_props_4_0.png

Derive \(S_{CO}\) to \(M_{mol}\) conversion.

[4]:
# Calculate molecular mass for 1 Jy km/s at 1 Mpc.
# These serve as fiducial distance and flux which we will scale later.
sco  = 1 * u.Jy * u.km / u.s
dmpc = (1 * u.Mpc).to(u.pc)
alphaco = 4.3 * u.solMass * u.s / (u.K * u.km * u.pc**2) # Bolatto+13
freq = 115.271204 * u.GHz
kperjy = (1*u.Jy/u.sr).to(u.K, equivalencies=u.brightness_temperature(freq))
molmass = alphaco * kperjy * (sco/u.Jy) * dmpc**2
print('At 1 Mpc, 1 Jy km/s of CO flux is {:.1f} of H_2'.format(molmass))
At 1 Mpc, 1 Jy km/s of CO flux is 10533.1 solMass of H_2

Plot derived CO masses, a la Bolatto et al. (2017) Figure 5. Need to merge in two additional tables.

[5]:
# Measured CO fluxes
natv_co = EdgeTable('edge_coflux_natv.csv')
# CALIFA params incl. distance
califa = EdgeTable('edge_califa.csv')
natv_co.join(califa)
natv_co.join(coobs)
WARNING: MergeConflictWarning: In merged column 'Name' the 'description' attribute does not match (Galaxy Name != CALIFA Name).  Using CALIFA Name for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'date' types <class 'str'> and <class 'str'>, choosing date='2023-12-25' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'comments' types <class 'str'> and <class 'str'>, choosing comments='Galaxy properties determined from CALIFA' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: In merged column 'Name' the 'description' attribute does not match (CALIFA Name != Galaxy Name).  Using Galaxy Name for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'comments' types <class 'str'> and <class 'str'>, choosing comments='Observational Parameters for CARMA D+E array cubes' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'date' types <class 'str'> and <class 'str'>, choosing date='2023-06-20' [astropy.utils.metadata.merge]
[6]:
print(natv_co.colnames)
['Name', 'coRactr_natv', 'coDectr_natv', 'coCtrint_natv', 'coDvhel', 'coBmaj_natv', 'coBmin_natv', 'coBpa_natv', 'coNomask_natv', 'coeNomask_natv', 'coNomaskDv_natv', 'coDilated_natv', 'coeDilated_natv', 'coSmooth_natv', 'coeSmooth_natv', 'coSmoothDv_natv', 'coMask2d_natv', 'coeMask2d_natv', 'coSNRmax_natv', 'coSNR4pix_natv', 'coSNR5pix_natv', 'cottBmaj_natv', 'cottBmin_natv', 'cottBpa_natv', 'cottNomask_natv', 'cotteNomask_natv', 'cottNomaskDv_natv', 'cottDilated_natv', 'cotteDilated_natv', 'cottSmooth_natv', 'cotteSmooth_natv', 'cottSmoothDv_natv', 'cottMask2d_natv', 'cotteMask2d_natv', 'cottSNRmax_natv', 'cottSNR4pix_natv', 'cottSNR5pix_natv', 'ID', 'caSu', 'caSg', 'caSr', 'caSi', 'caB', 'caV', 'caR', 'caRe', 'caeRe', 'caEllipticity', 'caPA', 'caR50', 'caeR50', 'caR90', 'caeR90', 'cazgas', 'cazstars', 'caAge', 'caeAge', 'caFHa', 'caFHacorr', 'caLHacorr', 'caMstars', 'caeMstars', 'caSFR', 'caeSFR', 'caOH', 'caeOH', 'caAvgas', 'caeAvgas', 'caAvstars', 'caeAvstars', 'caDistP3d', 'caDistMpc', 'caFlgWav5', 'caFlgWav12', 'caFlgReg5', 'caFlgReg12', 'caFlgImg5', 'caFlgImg12', 'coVsys', 'coDEobstim', 'coNpt', 'coDEbmaj', 'coDEbmin', 'coRMS_10', 'coTpk_10', 'coSNRpeak_10', 'ImagingDate_10', 'coRMS_20', 'coTpk_20', 'coSNRpeak_20', 'ImagingDate_20']
[7]:
fig=plt.figure(figsize=(15, 4))

# Histogram of distance
ax1=plt.subplot(1,4,1)
plt.hist(natv_co['caDistMpc'],bins=np.arange(10, 150, 10), ec='black')
plt.xlabel('Distance [Mpc]', labelpad=3, fontsize='large')
plt.ylabel('Number of galaxies', labelpad=3, fontsize='large')
tick_spacing = 2
ax1.yaxis.set_major_locator(ticker.MultipleLocator(tick_spacing))
ax1.text(0.95,0.88,'$\mu$ = %3.1f' % np.mean(natv_co['caDistMpc']),
    ha='right', transform=ax1.transAxes)

# Histogram of beam physical size
ax2=plt.subplot(1,4,2)
beam = (np.sqrt(natv_co['coBmaj_natv']*natv_co['coBmin_natv'])).to(u.rad)
bmkpc = beam.value*natv_co['caDistMpc']*1000.
plt.hist(bmkpc,bins=np.arange(0, 4, 0.25), ec='black')
plt.xlabel('beam [kpc]', labelpad=3, fontsize='large')
ax2.text(0.95,0.88,'$\mu$ = %3.1f' % np.mean(bmkpc),
    ha='right', transform=ax2.transAxes)

# Histogram of beam mass sensitivity
ax3=plt.subplot(1,4,3)
# Convert mK to Jy/bm
omega_B = np.pi/(4*np.log(2)) * beam**2
conv = (u.Jy/omega_B).to(u.mK, equivalencies=u.brightness_temperature(freq))
mkperjy = conv.value
# Multiply 10 km/s noise by sqrt(3) to get sensitivity to a 30 km/s line
# Multiply by 4 to get 4-sigma sensitivity
msens = 4*molmass*(natv_co['caDistMpc']**2)*(natv_co['coRMS_10']/mkperjy)*10.*np.sqrt(3)
plt.hist(msens.value,bins=np.logspace(6, 9, num=20), ec='black')
plt.xlabel('$M_{sen,beam}$ [$M_\odot$]', labelpad=3, fontsize='large')
ax3.set_xscale("log")
ax3.text(0.95,0.88,'$\mu$ = %4.1e' % np.mean(msens.value),
    ha='right', transform=ax3.transAxes)

# Histogram of molecular gas mass
ax4=plt.subplot(1,4,4)
mgas = molmass*natv_co['caDistMpc']**2*natv_co['coSmooth_natv']
mgas = mgas[~np.isnan(mgas)]
plt.hist(mgas.value,bins=np.logspace(7.5, 11.5, num=20), ec='black')
plt.xlabel('$M_{mol}$ [$M_\odot$]', labelpad=3, fontsize='large')
ax4.set_xscale("log")
ax4.yaxis.set_major_locator(ticker.MultipleLocator(tick_spacing))
ax4.text(0.95,0.88,'$\mu$ = %4.1e' % np.mean(mgas.value),
    ha='right', transform=ax4.transAxes)

plt.show()
_images/global_props_10_0.png

CO fluxes from 7” resolution cubes

[8]:
db = EdgeTable('edge_coflux_smo7.csv')
db.join(califa)
print('Stellar mass units:', db['caMstars'].unit)
print('SFR units:', db['caSFR'].unit)
Stellar mass units: dex(solMass)
SFR units: dex(solMass / yr)
[9]:
# Define the subsets
valid_ssfr = (~np.isnan(db['caMstars'])) & (~np.isnan(db['caSFR']))
valid_mgas = (~np.isnan(db['caMstars'])) & (~np.isnan(db['caSFR']))
co_det  = valid_ssfr & (~np.isnan(db['coDilated_smo7']))
print('Number of CO detections:',np.count_nonzero(co_det))
co_ndet = valid_ssfr & (np.isnan(db['coDilated_smo7']))
print('Number of CO non-detections:',np.count_nonzero(co_ndet))
Number of CO detections: 105
Number of CO non-detections: 21
[10]:
# Scale noise estimate from unmasked moment map to a more realistic velocity window
print('Median unmasked velocity width is',np.nanmedian(db['coNomaskDv_smo7']))
print('Median masked velocity width is',np.nanmedian(db['coDilatedDv_smo7']))
nsefactor = np.sqrt(np.nanmedian(db['coDilatedDv_smo7'])/np.nanmedian(db['coNomaskDv_smo7']))
print('Noise estimates will be scaled down by',nsefactor)
Median unmasked velocity width is 860.0
Median masked velocity width is 400.0
Noise estimates will be scaled down by 0.6819943394704735
[11]:
# Calculate gas mass, gas fraction, and offset from SFMS
# Main sequence from Cano-Diaz et al. (2016ApJ...821L..26C)
delsfr  = db['caSFR'] - (0.81*db['caMstars']-8.34)
mgas = np.log10(molmass.value * db['coDilated_smo7'] * db['caDistMpc']**2)
mgas[co_ndet] = np.log10(molmass.value *
                         2*nsefactor*db['coeNomask_smo7'][co_ndet]
                         * db['caDistMpc'][co_ndet]**2)
fgas = mgas - db['caMstars']

Database paper plot, EDGE only

[16]:
fig, (ax1,ax2) = plt.subplots(1,2, figsize=(7,4))

# Plot the data
ax1.scatter(db['caMstars'][co_det],db['caSFR'][co_det],
            c='tab:blue', alpha=0.5, label='CO det')
ax1.scatter(db['caMstars'][co_ndet],db['caSFR'][co_ndet], marker='s',
            c='tab:red', alpha=0.5, s=20, label='CO ndet')

# Main sequence from Cano-Diaz et al. (2016ApJ...821L..26C)
x_ms = np.linspace(9,12,num=50)
y_ms = 0.81*x_ms-8.34
ax1.plot(x_ms,y_ms,'m--', zorder=-2)
ax1.legend(loc='lower right', handletextpad=0.01, fontsize=9)

# Axis labels
ax1.set_xlabel('log($M_*$ [$M_\odot$])', fontsize=14)
ax1.set_ylabel('log(SFR [$M_\odot$ yr$^{-1}$])', fontsize=14)
ax1.set_aspect('equal')
ax1.set_xlim(8.75,12.25)
ax1.set_ylim(-3,2)

# Annotations
ax1.text(0.04,0.94, '(a)', size=12, ha='left',
         va='center', transform=ax1.transAxes)
ax1.text(0.92,0.92, 'MS', size=12, ha='center', color='m',
         va='center', transform=ax1.transAxes)

# Plot the data
ax2.scatter(fgas[co_det],delsfr[co_det],c='tab:blue', alpha=0.5)

# Plot the upper limits
uplims = np.ones(fgas[co_ndet].shape)
ax2.errorbar(fgas[co_ndet], delsfr[co_ndet], xuplims=uplims,
             xerr=0.2, ls='none', color='tab:red', zorder=-2, alpha=0.7)

# Axis labels
ax2.set_ylabel(r'log(SFR) - log(SFR$_{\rm MS}$)', fontsize=14)
ax2.set_xlabel('log($M(H_2)/M_*$)', fontsize=14)
ax2.set_aspect('equal')
ax2.set_xlim(-3,0)
ax2.set_ylim(-3,2)
ax2.text(0.05,0.94, '(b)', size=12, ha='left', va='center', transform=ax2.transAxes)

plt.subplots_adjust(wspace=0.1)
plt.savefig('sfms.pdf', bbox_inches='tight')
_images/global_props_22_0.png

Database paper plot, EDGE+DR3

[17]:
fig, (ax1,ax2) = plt.subplots(1,2, figsize=(7.25,4))

# Plot the data
ax1.scatter(califa['caMstars'],califa['caSFR'], c='dimgrey', s=6, alpha=0.2)
ax1.scatter(db['caMstars'][co_det],db['caSFR'][co_det],
            c='tab:blue', alpha=0.5, label='CO det')
ax1.scatter(db['caMstars'][co_ndet],db['caSFR'][co_ndet], marker='s',
            c='tab:red', alpha=0.5, s=20, label='CO ndet')

# Main sequence from Cano-Diaz et al. (2016ApJ...821L..26C)
x_ms = np.linspace(9,12,num=50)
y_ms = 0.81*x_ms-8.34
ax1.plot(x_ms,y_ms,'m--', zorder=-2)
ax1.legend(loc='lower right', handletextpad=0.01, fontsize=9)

# Axis labels
ax1.set_xlabel('log($M_*$ [$M_\odot$])', fontsize=14)
ax1.set_ylabel('log(SFR [$M_\odot$ yr$^{-1}$])', fontsize=14)
ax1.set_aspect('equal')
ax1.set_xlim(8.25,12.25)
ax1.set_ylim(-3,2)

# Annotations
ax1.text(0.04,0.94, '(a)', size=12, ha='left',
         va='center', transform=ax1.transAxes)
ax1.text(0.92,0.92, 'MS', size=12, ha='center', color='m',
         va='center', transform=ax1.transAxes)

# Plot the data
ax2.scatter(fgas[co_det],delsfr[co_det],c='tab:blue', alpha=0.5)

# Plot the upper limits
uplims = np.ones(fgas[co_ndet].shape)
ax2.errorbar(fgas[co_ndet], delsfr[co_ndet], xuplims=uplims,
             xerr=0.2, ls='none', color='tab:red', zorder=-2, alpha=0.7)

# Axis labels
ax2.set_ylabel(r'log(SFR) - log(SFR$_{\rm MS}$)', fontsize=14)
ax2.set_xlabel('log($M(H_2)/M_*$)', fontsize=14)
ax2.set_aspect('equal')
ax2.set_xlim(-3,0)
ax2.set_ylim(-3,2)
ax2.text(0.05,0.94, '(b)', size=12, ha='left', va='center', transform=ax2.transAxes)

plt.subplots_adjust(wspace=0.1)
plt.savefig('sfms_dr3.pdf', bbox_inches='tight')
_images/global_props_24_0.png
[ ]: