data = Import["~/data.csv", {"Data", All, {1, 2, 3, 7}}];
dt = Table[{
Quantity[
UnixTime[FromDateString[data[[i, 1]] <> " " <> data[[i, 2]]]],
"Seconds"],
Quantity[data[[i, 3]], "Hertz"],
data[[i, 4]]
}, {i, Length[data]}
];
(* Define custom tick functions *)
xTicks = Charting`ScaledTicks[{Identity,
QuantityMagnitude[Quantity[#, "Seconds"]] &}];
yTicks = Charting`ScaledTicks[{QuantityMagnitude, Identity}];
ListDensityPlot[dt, ImageSize -> Large,
FrameTicks -> {{yTicks, None}, {xTicks, None}},
FrameLabel -> {"Frequency", "Time"},
LabelStyle -> Directive[FontSize -> 12],
PlotLabel -> "Density Plot of RTL Power Data"]
In this code:
- xTicks and yTicks are custom tick functions that format the ticks on the X and Y axes, respectively.
- ChartingScaledTicks` is used to create custom ticks that handle the conversion between Unix
- timestamps and date strings and between Hertz and numerical values.
- FrameTicks option is used to specify the custom tick functions for the X and Y axes.
- FrameLabel is used to add labels to the axes.
- LabelStyle is used to set the font size for the axis labels.
- PlotLabel is used to add a title to the plot.
This configuration should format the X and Y axes according to your requirements. Adjust the LabelStyle and other formatting options as needed to match your desired visual style. I hope that helps you