6

I'm attempting to generate some histograms, and I'd like to automatically label the X-axis. However, Histogram[. . ., AxesLabel -> {"X", "Y"}] places the "X" label on the RHS of the axis. How do I direct that the "X" label should be positioned below the axis? I need some automated method (I can of course move it by hand), since I'm going to be generating hundreds of diagrams.

Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
Roger Harris
  • 1,497
  • 1
  • 12
  • 20
  • 1
    Related question: https://mathematica.stackexchange.com/questions/17902/how-to-place-legend-labels-for-histogram-and-listlineplots-correctly – Karolis Apr 26 '17 at 16:30

2 Answers2

5

You can use Frame->True

Histogram[{1, 2, 3}, Frame -> True, FrameLabel -> {{"Y", None}, {"X", "my histogram"}}, 
  RotateLabel -> False]

Mathematica graphics

Nasser
  • 143,286
  • 11
  • 154
  • 359
4

I wish there was a way of doing it without the frame - Karolis

Labeled[Histogram[{1, 2, 3}], {"X", "Y"}, {Bottom, Left}]

Mathematica graphics

kglr
  • 394,356
  • 18
  • 477
  • 896