The problem came up in a plot of RGB data obtained by imaging the variable star d-Cephei with a DSLR camera on several successive nights. I tried to plot the R, G, B intensity points for each day in a column and place a bitmap of the star (taken that day) over the column. This worked fine with ListPlot
during September, but with October coming up, it was clear I would need something like DateListPlot
. But when I substituted DateListPlot
, after rewriting the data structures appropriately, I found that the points would plot, but the bitmaps that I had inserted with Epilog
disappeared. Furthermore, by adding a PlotRange
statement, I could get the bitmaps, but the R, G, B intensity points would not display.
In what follows, I have tried to boil it down using just one suitable list of points for one color and just one bitmap created by rasterizing a Disk. Somewhat to my surprise, the problem is reproducible. As written, the image plotted with ListPlot
shows it working properly, but it lacks the formatting of the date information on the x axis. The image plotted with DateListPlot
formats the dates nicely, but it doesn't show the bitmap. My questions are:
- What will make the bitmap display with
DateListPlot
? - How can I move the bitmap display above the range of the points on the Y axis, and below the title?
- Is it possible to specify a
PlotRange
in DateListPlot? How would one specify the range for the x axis? - Why does this happen?
- When will a book be published listing all the do's and don't's of plots and graphics in Mathematica?
My code follows:
Clear[disk, datePts, pts, dateListPlot, listPlot]
disk = Rasterize[Graphics[Disk[]]];
datePts = {{{2012, 9, 24}, .1}, {{2012, 9, 25}, .35}, {{2012, 9,
26}, .75}, {{2012, 9, 27}, .90}, {{2012, 9, 28}, .60}, {{2012, 9,
29}, .30}, {{2012, 9, 30}, .10}};
pts = {#[[1, 3]], #[[2]]} & /@ datePts;
ListPlot[
pts,
PlotStyle -> Directive[{Red, PointSize[Large]}],
PlotLabel -> "ListPlot: Epilog disk visible",
Epilog -> Inset[disk, {23.75, .8}, {0, 0}, .4],
PlotRange -> {{23.5, 30.5}, {0, 1}},
Background -> LightGray
]
DateListPlot[
datePts,
PlotStyle -> Directive[{Red, PointSize[Large]}],
PlotLabel -> "DateListPlot: Epilog disk not visible",
Epilog -> Inset[disk, {23.75, .8}, {0, 0}, .4],
(* Activate PlotRange makes Epilog visible, but points will not be visible. *)
(*PlotRange->{{23,30},{0,1}},*)
Background -> LightGray
]