Skip to main content
Removed some duplicate code that resulted in error messages (`DateHistogram[`).
Source Link

DateHistogram was added in version 10.2, and uses date-specific bins and ticks.

I'll use the same {month, day} data as my other example, but instead of transforming the dates ahead of time, I can use DateFunction to provide the interpretation automatically.

blossom = {{4, 3}, {4, 22}, {4, 15}, {4, 2}, {4, 18}, {4, 20}, {4, 
    12}, {3, 30}, {4, 4}, {4, 24}, {4, 26}, {3, 4}, {4, 26}, {4, 
    13}, {5, 1}, {4, 4}, {4, 8}, {4, 18}, {4, 9}, {4, 19}, {4, 
    10}, {4, 20}, {4, 3}, {4, 4}, {3, 21}, {4, 19}, {4, 15}, {4, 
    17}, {4, 9}, {4, 17}, {4, 9}, {4, 8}, {4, 23}, {4, 17}, {4, 
    1}, {4, 10}, {4, 15}, {4, 15}, {4, 11}, {4, 15}, {4, 19}, {4, 
    22}, {4, 11}, {4, 4}, {4, 12}, {3, 27}, {3, 24}, {4, 26}, {3, 
    28}, {4, 16}};
ripen = TranslationTransform[{2, 0}][blossom]; 

Weekly bins

DateHistogram[DateHistogram[DateHistogram[{blossom, ripen}, "Week", 
    DateFunction -> (DateObject[Prepend[#, 2015]] &)]

enter image description here

Daily bins

DateHistogram[DateHistogram[DateHistogram[{blossom, ripen}, "Day", 
    DateFunction -> (DateObject[Prepend[#, 2015]] &)]

enter image description here

DateHistogram was added in version 10.2, and uses date-specific bins and ticks.

I'll use the same {month, day} data as my other example, but instead of transforming the dates ahead of time, I can use DateFunction to provide the interpretation automatically.

blossom = {{4, 3}, {4, 22}, {4, 15}, {4, 2}, {4, 18}, {4, 20}, {4, 
    12}, {3, 30}, {4, 4}, {4, 24}, {4, 26}, {3, 4}, {4, 26}, {4, 
    13}, {5, 1}, {4, 4}, {4, 8}, {4, 18}, {4, 9}, {4, 19}, {4, 
    10}, {4, 20}, {4, 3}, {4, 4}, {3, 21}, {4, 19}, {4, 15}, {4, 
    17}, {4, 9}, {4, 17}, {4, 9}, {4, 8}, {4, 23}, {4, 17}, {4, 
    1}, {4, 10}, {4, 15}, {4, 15}, {4, 11}, {4, 15}, {4, 19}, {4, 
    22}, {4, 11}, {4, 4}, {4, 12}, {3, 27}, {3, 24}, {4, 26}, {3, 
    28}, {4, 16}};
ripen = TranslationTransform[{2, 0}][blossom]; 

Weekly bins

DateHistogram[DateHistogram[{blossom, ripen}, "Week", 
    DateFunction -> (DateObject[Prepend[#, 2015]] &)]

enter image description here

Daily bins

DateHistogram[DateHistogram[{blossom, ripen}, "Day", 
    DateFunction -> (DateObject[Prepend[#, 2015]] &)]

enter image description here

DateHistogram was added in version 10.2, and uses date-specific bins and ticks.

I'll use the same {month, day} data as my other example, but instead of transforming the dates ahead of time, I can use DateFunction to provide the interpretation automatically.

blossom = {{4, 3}, {4, 22}, {4, 15}, {4, 2}, {4, 18}, {4, 20}, {4, 
    12}, {3, 30}, {4, 4}, {4, 24}, {4, 26}, {3, 4}, {4, 26}, {4, 
    13}, {5, 1}, {4, 4}, {4, 8}, {4, 18}, {4, 9}, {4, 19}, {4, 
    10}, {4, 20}, {4, 3}, {4, 4}, {3, 21}, {4, 19}, {4, 15}, {4, 
    17}, {4, 9}, {4, 17}, {4, 9}, {4, 8}, {4, 23}, {4, 17}, {4, 
    1}, {4, 10}, {4, 15}, {4, 15}, {4, 11}, {4, 15}, {4, 19}, {4, 
    22}, {4, 11}, {4, 4}, {4, 12}, {3, 27}, {3, 24}, {4, 26}, {3, 
    28}, {4, 16}};
ripen = TranslationTransform[{2, 0}][blossom]; 

Weekly bins

DateHistogram[{blossom, ripen}, "Week", 
    DateFunction -> (DateObject[Prepend[#, 2015]] &)]

enter image description here

Daily bins

DateHistogram[{blossom, ripen}, "Day", 
    DateFunction -> (DateObject[Prepend[#, 2015]] &)]

enter image description here

Source Link
Brett Champion
  • 20.9k
  • 2
  • 65
  • 122

DateHistogram was added in version 10.2, and uses date-specific bins and ticks.

I'll use the same {month, day} data as my other example, but instead of transforming the dates ahead of time, I can use DateFunction to provide the interpretation automatically.

blossom = {{4, 3}, {4, 22}, {4, 15}, {4, 2}, {4, 18}, {4, 20}, {4, 
    12}, {3, 30}, {4, 4}, {4, 24}, {4, 26}, {3, 4}, {4, 26}, {4, 
    13}, {5, 1}, {4, 4}, {4, 8}, {4, 18}, {4, 9}, {4, 19}, {4, 
    10}, {4, 20}, {4, 3}, {4, 4}, {3, 21}, {4, 19}, {4, 15}, {4, 
    17}, {4, 9}, {4, 17}, {4, 9}, {4, 8}, {4, 23}, {4, 17}, {4, 
    1}, {4, 10}, {4, 15}, {4, 15}, {4, 11}, {4, 15}, {4, 19}, {4, 
    22}, {4, 11}, {4, 4}, {4, 12}, {3, 27}, {3, 24}, {4, 26}, {3, 
    28}, {4, 16}};
ripen = TranslationTransform[{2, 0}][blossom]; 

Weekly bins

DateHistogram[DateHistogram[{blossom, ripen}, "Week", 
    DateFunction -> (DateObject[Prepend[#, 2015]] &)]

enter image description here

Daily bins

DateHistogram[DateHistogram[{blossom, ripen}, "Day", 
    DateFunction -> (DateObject[Prepend[#, 2015]] &)]

enter image description here