# This routine illustrates the mean and median for Lorentzian distributed random numbers.
# For best effect, it can first be run _without_ showing the median (i.e., showmedian=0),
# just prior to introducing the median.
function lorentzian_example(npts,fignum,showmedian)
	figure(fignum)
	hold off
	clf
	dat=cauchy_rnd(0,1,npts,1);
	hist(dat,[-5:.25:5])
#	hist(dat)
	hold on
	plot(mean(dat),0,'.d','markersize',15)
	if (showmedian == 1)
		plot(median(dat),0,'.o','markersize',15)
		legend("","Mean","Median")
	else
		legend("","Mean")
	endif
	title(sprintf("Lorentzian Distribution Histogram, %i points",npts));
	hold off
endfunction