Is there a way to rotate TickMarks in DateListPlot to avoid overlap, eg:
Part of the code used to generate this is:
TimelineGr[file_] :=
DateListPlot[{{First[#], 1}, {Last[#], Length@#}} &@
Sort@Flatten[ Last /@ I2B2[file, dateIntervals], 1],
Epilog -> ({Text[First@#, {First@Last@#, First@#2}, {1, 0}], Blue,
Rectangle[{First@Last@#, First@#2}, {Last@Last@#,
First@#2 + 0.1}]} &~MapIndexed ~ I2B2[file, dateIntervals]),
PlotRange -> All, AspectRatio -> 1/4, ImageSize -> 800,
DateTicksFormat -> {"Year", "/", "Month", "/", "Day"},
FrameTicks -> {{Automatic, Automatic}, {
First[Last[#]] & /@ I2B2[file, dateIntervals], Automatic}},
PlotLabel -> file <> ".xml"
]
(Note, this includes custom functions)
If not, this is just another example of why it's almost always better to write visualization from the bottom-up
Answer
Perhaps something like this?
data = {{{2006, 10, 1}, 10}, {{2006, 10, 15}, 12},
{{2006, 10, 30}, 15}, {{2006, 11, 20}, 20}};
p = DateListPlot[data];
Show[p,
Options[p, FrameTicks] /. s_String :> Rotate[s, 90 Degree]
]
If one prefers not to use Show
then:
p /. x : (FrameTicks -> _) :> (x /. s_String :> Rotate[s, 90 Degree])
Comments
Post a Comment