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 に答える