1
$\begingroup$

Given the following code for plotting DateHistogram:

DateHistogram[
    {DateObject[{2018,10,3,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,26,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,25,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,26,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,29,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,30,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,30,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,29,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,30,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,29,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,15,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,15,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,1,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,10,30,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,1,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,6,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,1,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,1,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,6,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,1,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,1,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2019,2,15,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,1,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,5,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,6,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,6,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,3,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,3,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,5,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,7,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,12,12,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,4,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2019,11,1,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,6,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,2,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,3,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,7,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,7,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,6,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,6,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,6,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,7,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2019,11,20,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,6,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2019,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2019,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,9,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,9,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,16,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,9,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,12,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,8,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,9,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,15,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,9,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,9,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,9,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,9,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,9,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,16,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,13,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,16,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,10,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,10,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,10,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,10,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,10,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,14,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,15,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,16,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,16,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,16,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,12,11,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,20,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,20,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,16,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,20,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,16,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,17,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,20,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,29,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,19,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,20,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,23,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,20,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,20,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,30,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2019,2,1,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,26,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2019,11,22,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,22,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,20,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,22,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,21,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,22,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,28,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,22,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,24,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,23,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,23,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,23,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,23,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,26,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2018,11,24,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,26,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,26,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,23,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,25,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,27,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,29,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,26,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,26,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],Missing["NoInput"],DateObject[{2018,11,27,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,27,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,27,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],Missing["NoInput"],DateObject[{2018,11,26,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,27,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,28,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,28,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,9,28,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,28,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,28,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,30,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,28,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,30,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,28,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,30,0,0,0.`},"Instant","Gregorian",0.`],DateObject[{2018,11,30,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],Missing["NoInput"],DateObject[{2018,12,11,0,0,0.`},"Instant","Gregorian",0.`],Missing["NoInput"],DateObject[{2019,11,14,0,0,0.`},"Instant","Gregorian",0.`]},
    "Day",
    PlotRange->{{DateObject[{2018,10,23}],DateObject[{2018,12,5}]},All},
    PlotTheme->"Detailed",
    DateTicksFormat->{"Day","-","MonthNameShort","-","Year"}
]

How do I make the DateTicks appear for every Day and Rotate[#,90 Degree]&?

$\endgroup$

1 Answer 1

2
$\begingroup$

You can construct the list of date ticks and use it with FrameTicks:

dateticks = {AbsoluteTime[#], 
     Rotate[DateString[#, {"Day", "-", "MonthNameShort", "-", "Year"}], 90 Degree], 0} & /@ 
   DateRange[## & @@ DateBounds[DeleteMissing[DeleteDuplicates@dates]], "Day"];
DateHistogram[dates, "Day", 
 PlotRange -> {{DateObject[{2018, 10, 23}], DateObject[{2018, 12, 5}]}, All},
 PlotTheme -> "Detailed", 
 FrameTicks -> {{Automatic, Automatic}, { dateticks, Automatic}}, 
 ImageSize -> Large]

enter image description here

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.