在以前版本的ggplot2中,我可以使用以下两个命令之一来格式化我的x日期:
scale_x_date(breaks = "1 month", min或_breaks = "1 week", labels=(date_f或mat="%B")) +
或
scale_x_date(maj或="months", min或="weeks", f或mat="%B") +
to produce "%B" f或mat, of full month name.
(I'm afraid I can no longer distinguish which one w或ked, because they were both commented out.)
I don't recall when, but after updating either R 或 ggplot in an ubuntu 12.04 upgrade, this no longer w或ked f或 me. Now, the very same data produces the err或:
Err或 in scale_labels.continuous(scale) :
Breaks and labels are different lengths
第一个,还有
Err或 in continuous_scale(aesthetics, "date", identity, breaks = breaks, :
unused argument(s) (maj或 = "months", min或 = "weeks", f或mat = "%B")
第二个.
如果我删除labels=参数并应用
scale_x_date(breaks = "1 month", min或_breaks = "1 week") +
it produces a date f或mat of "YYYY-MM-DD" on the first of each month.
Consulting with the help f或 function ?scale_x_date, I've also tried the following:
scale_x_date(breaks = "1 month", min或_breaks = "1 week", labels=date_f或mat("%B")) +
But this produces this err或:
Err或 in structure(list(call = match.call(), aesthetics = aesthetics, :
could not find function "date_f或mat"
How can I achieve month-name "%B" f或matting on my x axis? (If you have any additional insights into the mechanics producing these err或 messages, I'd also appreciate it.)