pro pp_plot_with_ttest,a,b,z=z,mask=mask,sig=sig,_extra=e ; Purpose: plot diff of avg of 2 vectors of pp-fields, and add in their sig ; Category: pp statistics ; Inputs: ; a,b - vectors of pp-fields ; Keywords: ; z=z - if supplied, use the z-field given. Saves time. If supplied undefined, ; returns the value calculated ; mask=mask - returns the mask field created for significance ; sig=sig - change the default of 95% (0.05) @comm_error a1=pp_avg(a) b1=pp_avg(b) if (n_elements(sig) eq 0) then sig=0.05 pp_plot,la=90,ster=0,pp_diff(a1,b1),_extra=e if (n_elements(z) eq 0) then z=pp_ttest(a,b) mask=pp_set_mask(z,'f1.data lt '+shtstr(sig)) mask_plot,fil=-!p.color,mask,ori=45,/li,th=2 print,'Mask covers: ',pp_mask_fraction(mask)*100,' % of area' end