Mercurial > hg > octave-image
changeset 681:341c8d3ee3c5
imhist: adjust y axis for outliers
author | carandraug |
---|---|
date | Fri, 23 Nov 2012 00:09:27 +0000 |
parents | 64af90213060 |
children | 205e5f657033 |
files | NEWS inst/imhist.m |
diffstat | 2 files changed, 16 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS +++ b/NEWS @@ -4,7 +4,8 @@ ** The plot produced by `imhist' is correctly scaled on the X axis so that the colorbar corresponds to the actual intensity of the stems; the given colormarp is used on the colorbar for indexed images; and the stems no - longer display the markers at their top. + longer display the markers at their top. The Y axis is also adjusted in case + of peaks with high values that prevent a good overview of the histogram. ** The `fftconv2' usage "fftconv2 (v1, v2, a)", for convolution of a matrix by one vector in the column direction and another vector in the row direction,
--- a/inst/imhist.m +++ b/inst/imhist.m @@ -29,6 +29,10 @@ ## @var{x} is a range for the bins so that @code{stem (@var{x}, @var{counts})} will ## show the histogram. ## +## @emph{Note:} specially high peaks that may prevent an overview of the histogram +## may not be displayed. To avoid this, use @code{axis "auto y"} after the call +## to @code{imhist}. +## ## @seealso{hist, histc, histeq} ## @end deftypefn @@ -139,6 +143,16 @@ else stem (bins, nn, "marker", "none"); xlim ([bins(1) bins(end)]); + ## we remove the box to see values with a value fo 255 (we can't remove the + ## line on the right since that wil remove the numbers and tics at the same + ## time) + box off; + ## if values are above this, they are likely outliers and prevent the + ## overview of the histogram + ylimit = median (nn) * 10; + if (ylim()(2) > ylimit) + ylim ([0 round(ylimit)]); + endif if (indexed) colormap (b); else