Closed llrs closed 5 months ago
Hi Lluís, is this perhaps a duplicate of #4335?
I searched before posting but didn't find it :man_facepalming: . At least I am consistent, and your solution works.
p + scale_x_time(
name = element_none(),
breaks = breaks_width("2 hours"),
labels = label_time("%H:%M")
)
Sorry for more notification noise!
I am using ggplot2 to render the daily electricity prices and compare it with the previous day price. Very useful! I show both prices on the same plot covering 24h, but the plot is showing seconds when the accuracy of the data is only hours, because the time is ingested as POSIXct.
It would be nice if
scale_{x|y}_time
could handledate_label
ordate_breaks
, otherwise I am forced to use some ugly transformation. If the name of the argument is not good as the time is not date it would be nice if the labels or breaks would follow the same principle as indate_label
anddate_breaks
for datetime and other relatedscale_*time
functionsI think this should be posted here and if useful could need some scales change.
Created on 2024-03-29 with reprex v2.1.0