0

我添加以下代码:

    scale_fill_continuous(limits=c(0.0001, 28),trans = "log", 
                           low = "green", high = "red",
                           breaks=c(0.0001,0.001,0.01,0.1,1,3,10,25))

图例上的文字应该是

    (0.0001,0.0010,0.0100,0.1000,1.0000,3.0000,10.0000,25.0000)

如何去除图例文字上多余的零?如何使它们如下所示:

    (0.0001,0.001,0.01,0.1,1,3,10,25) 
4

1 回答 1

0

只需使用labels参数明确告诉ggplot2使用这些标签,即:

 scale_fill_continuous(limits=c(0.0001, 28),trans = "log", 
                       low = "green", high = "red",
                       breaks=c(0.0001,0.001,0.01,0.1,1,3,10,25),
                       labels=c("0.0001","0.001","0.01","0.1","1","3","10","25"))
于 2013-01-08T14:28:42.087 回答