I want to align my x-axis labels in Incanter's histogram (based on JFreeChart) so that they are centered under the bars. I also want to get rid of the fractional axis tick marks.
My question is very similar to JFreeChart: Aligning domain axis with histogram bins.
Here are related questions for other languages:
(require '[incanter.charts :refer [histogram]])
(require '[incanter.core :refer [view]])
(def data [1 1 1 1 3 6])
(view (histogram data))

P.S. The histogram is also unappealing in that the bar for 6 is to the left of the tick mark. The other bars are to the right of their tick marks!
Update: See also:
- Relevant, but I don't see a solution here: How to center bars on tick marks
Based on reviewing the Incanter source code and the JFreeChart documentation, I don't believe that
org.jfree.chart.ChartFactory/createHistogramexposes the functionality to customize the axis. (I could be wrong -- perhaps you can modify the axis after using that factory method.)In any case, I found it easier (and perhaps necessary) to use the
bar-chartdirectly:Use it like this: