0
$\begingroup$

These observations are from Mathematica 12.3.0.0 on Linux x86 (64 Bit).

With AxisLabel->{"A", "number"} the character A sometimes slips directly to the end of the abscissa in the context of Histogram, especially if the histogram has a few outliers far to the right. Even a few spaces before the abscissa label, like AxisLabel->{" A", "number"} do not improve it.

a histogram with outliers and unreasonable positioning of abscissa axis label

If you call Histogram for the same data with the option PlotRange->All, then there remains a reasonable distance between the end of the axis. Then, of course, all extreme outliers are displayed on the abscissa (or they are not visible after all, because such small frequencies are lost in the display).

The displayed data (extracted from the histogram as described in How to extract bar heights from histogram are:

{{10.,9},{15.,405},{20.,8117},{25.,7738},{30.,9708},{35.,24467},{40.,42348},{45.,18129},{50.,43195},{55.,63039},{60.,16491},{65.,20030},{70.,17563},{75.,5361},{80.,19886},{85.,17787},{90.,14283},{95.,7998},{100.,3945},{105.,5469},{110.,808},{115.,1839},{120.,5501},{125.,1491},{130.,552},{135.,231},{140.,102},{145.,175},{150.,95},{155.,235},{160.,202},{165.,147},{170.,490},{175.,286},{180.,668},{185.,164},{190.,52},{195.,76},{200.,40},{205.,15},{210.,3},{220.,4},{225.,8},{230.,2},{235.,1},{240.,1},{245.,3},{255.,1},{260.,1},{275.,1}}

so the few outliers right of A=145 cause the wrong AxisLabel-behaviour in this case. Is it a bug? How can one overcome it without stretching the histogram to display all the not really relevant outliers?

$\endgroup$
2
  • $\begingroup$ Is this behavior related to the ImageSize? $\endgroup$
    – Syed
    Dec 19, 2022 at 11:32
  • $\begingroup$ The histogram is created with ` Print[Histogram[... , AxesLabel -> {"A", "number"}, ImageSize -> {400}]]` $\endgroup$ Dec 19, 2022 at 20:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.