@@ -379,7 +379,7 @@ def plot_dist(
379379 )
380380
381381 if (
382- (density_kwargs is not None )
382+ (density_kwargs is not False or face_kwargs is not False )
383383 and ("model" in distribution )
384384 and (plot_collection .coords is None )
385385 ):
@@ -417,11 +417,13 @@ def plot_dist(
417417 plot_collection , aes_by_visuals , "point_estimate" , sample_dims
418418 )
419419 if point_estimate == "median" :
420- point = distribution .median (dim = pe_dims , ** stats .get ("point_estimate" , {}))
420+ point = distribution .azstats . median (dim = pe_dims , ** stats .get ("point_estimate" , {}))
421421 elif point_estimate == "mean" :
422- point = distribution .mean (dim = pe_dims , ** stats .get ("point_estimate" , {}))
422+ point = distribution .azstats .mean (dim = pe_dims , ** stats .get ("point_estimate" , {}))
423+ elif point_estimate == "mode" :
424+ point = distribution .azstats .mode (dim = pe_dims , ** stats .get ("point_estimate" , {}))
423425 else :
424- raise NotImplementedError ( "coming soon " )
426+ raise ValueError ( "point_estimate must be either 'mean', 'median' or 'mode' " )
425427
426428 if pe_kwargs is not False :
427429 if "color" not in pe_aes :
@@ -437,7 +439,7 @@ def plot_dist(
437439 # point estimate text
438440 if pet_kwargs is not False :
439441 if density_kwargs is False and face_kwargs is False :
440- point_y = xr .full_like (point , 0.02 )
442+ point_y = xr .full_like (point , 0.05 )
441443 elif kind == "kde" :
442444 point_density_diff = [
443445 dim for dim in density .sel (plot_axis = "y" ).dims if dim not in point .dims
0 commit comments