我也看到过类似的问题,但答案似乎并没有帮助我的图表。我在这里有情节:
void Main()
{
DateTime? startDate = new DateTime(2019, 3, 5, 3, 0, 0);
DateTime? endDate = new DateTime(2019, 3, 15, 4, 0, 0);
TimeSpan result = (endDate - startDate).Value;
Console.WriteLine(result.ToString(@"dd\:hh\:mm\:ss"));
}
我正在尝试添加文字以将减少幅度描述为-29%。我尝试添加
n_cases_plot <- ggplot(data = n_cases, aes(x = month, y = n_cases, color
= "#668cff", fill = "#668cff")) +
geom_bar(stat = "identity") +
theme(panel.background = element_blank()) +
ggtitle("Number of Parole Cases Heard by Month") +
theme(plot.title = element_text(hjust = 0.4)) +
guides(fill=FALSE) +
guides(color = FALSE) +
xlab("") +
ylab("") +
theme(text=element_text(size=12, family="Georgia")) +
geom_smooth(method = lm, se = FALSE, aes(color = "lightskyblue1")) +
theme(panel.background = element_rect(fill = "moccasin")) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
但是我一直收到错误
+ annotate("text", x = 4, y = 10, "-29%")