Skip to content

Instantly share code, notes, and snippets.

@bczhc
Last active January 28, 2026 09:54
Show Gist options
  • Select an option

  • Save bczhc/4088589c2bbe8cee1eb01f8f9ee94fd0 to your computer and use it in GitHub Desktop.

Select an option

Save bczhc/4088589c2bbe8cee1eb01f8f9ee94fd0 to your computer and use it in GitHub Desktop.
Wolfram绘制时间-日期图表 #wolfram
plotHourDateScatter[timestamps_List] :=
Module[{timeList, hours, data, ts},
timeList = timestamps // FromUnixTime /@ # &;
hours = DateValue[#, "HourExact"] & /@ timeList // Parallelize;
data = MapThread[{#1, #2} &, {timeList, hours}];
ts = TimeSeries[data];
DateListPlot[ts, Joined -> False, ScalingFunctions -> "Reverse",
FrameLabel -> {"Date", "Time"}, ImageSize -> Large,
FrameTicks -> {{Table[{x,
StringRepeat["0", 2 - StringLength[ToString@x]] <>
ToString@x <> ":00"}, {x, 0, 24, 2}], None}, {Automatic,
None}}, PlotRange -> {Full, {-0.2, 24.2}},
DateTicksFormat -> {"Year", "/", "Month"}
]
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment