I have a multipanel plot of the following:
fig, axs = plt.subplots(1, 2, sharey=True, figsize = (20 , 10) , gridspec_kw={'hspace': 0, 'wspace': 0})
axs[0].scatter(fullmergedf['gf_re_j'] , fullmergedf['PAB_SFR_EX2'] , s = 200)
axs[0].scatter(fullmergedf['gf_re_j'] , fullmergedf['PAB_SFR_EX2_LL'] , s = 200 , marker = '+' , c = 'black')
axs[0].plot([0 , 2] , [0 , 0] , '--' , c = 'gray')
axs[0].set_ylabel(r'log($SFR_{Pa\beta}$) - log($SFR_{UV}^{corr}$)')
axs[0].set_xlabel(r"$R_{eff}$ [arcsec]")
axs[0].axis([0 , 1.7 , -2.5 , 3])
axs[1].scatter(fullmergedf['gf_n_j'] , fullmergedf['PAB_SFR_EX2'] , s = 200)
axs[1].scatter(fullmergedf['gf_n_j'] , fullmergedf['PAB_SFR_EX2_LL'] , s = 200 , marker = '+' , c = 'black')
axs[1].plot([0 , 8] , [0 , 0] , '--' , c = 'gray')
axs[1].set_xlabel(r"n")
axs[1].axis([0 , 3 , -2.5 , 3])
#axs[1].set_xscale('log')
plt.show()
I would like to remove some of the points in this scatter plot using a condition from another column in the dataframe. The condition needs to be that only points where fullmergedf['gf_f_j'] is 0 for that object. Is there an efficient method in pandas to do something like this?
x = fullmergedf['gf_re_j'][fullmergedf['gf_re_j'] == 0]andy = fullmergedf['PAB_SFR_EX2'][fullmergedf['gf_re_j'] == 0], thenax.scatter(x,y)(just breaking out to variables for readability).