From cea74ee2cdd40995dd9de2a05929e225f7a056cc Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Mon, 27 Mar 2023 16:51:36 +0200 Subject: [PATCH] ZH: rit: slice_figure colorbar kwargs --- .../airshower_beacon_simulation/lib/rit.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/simulations/airshower_beacon_simulation/lib/rit.py b/simulations/airshower_beacon_simulation/lib/rit.py index cf6a4f6..db0ae45 100644 --- a/simulations/airshower_beacon_simulation/lib/rit.py +++ b/simulations/airshower_beacon_simulation/lib/rit.py @@ -114,11 +114,21 @@ def shower_plane_slice(e,X=750.,Nx=10,Ny=10,wx=1e3,wy=1e3,xoff=0,yoff=0,zgr=0,n_ return xx,yy,p,locs[np.argmax(p)] -def slice_figure(e,X,xx,yy,p,mode='horizontal'): +def slice_figure(e,X,xx,yy,p,mode='horizontal', scatter_kwargs={}, colorbar_kwargs={'label':'Power'}): + scatter_kwargs = { + **dict( + cmap='Spectral_r', + alpha=0.9, + s=30 + ), + **scatter_kwargs + } + + fig, axs = plt.subplots(1,figsize=(10,8)) fig.suptitle(r'E = %.1f EeV, $\theta$ = %.1f$^\circ$, $\phi$ = %.1f$^\circ$ X = %.f'%(e.energy,e.zenith,e.azimuth,X)) - sc = axs.scatter(xx/1e3,yy/1e3,c=p,cmap='Spectral_r',alpha=0.6) - fig.colorbar(sc,ax=axs) + sc = axs.scatter(xx/1e3,yy/1e3,c=p,**scatter_kwargs) + fig.colorbar(sc,ax=axs, **colorbar_kwargs) zgr = 0 + e.core[2] dX = atm.distance_to_slant_depth(np.deg2rad(e.zenith),X,zgr) xc = np.sin(np.deg2rad(e.zenith))*np.cos(np.deg2rad(e.azimuth))* dX