Off topic:strange legend in ggplot
0
0
Entering edit mode
9.2 years ago

Hi,

I am having difficulties plotting the correct values in my legend on a ggplot + geom_tile

The command I am using is:

ggplot(PlotData, aes(y = start,  x = start.1)) +  
   geom_tile(aes(fill = Substraction)) + 
   scale_size(range = c(1, 200)) + 
   scale_fill_gradientn(
      colours = rainbow(100), 
      values = seq(0,1 , .1), 
      space = "Lab", 
      na.value = "white", 
      guide = "legend") + 
   ggsave(file=paste(PlotName, "_gplots1_1S.pdf", sep=""))

and the data I'. using as an input is a data.frame of dim 17766225x4, which looks line that:

       start start.1 Subtraction bins2
1_1001     1    1001     1.109193    12
1_2001     1    2001           NA    NA
1_3001     1    3001           NA    NA
1_4001     1    4001           NA    NA
1_5001     1    5001           NA    NA
1_6001     1    6001           NA    NA

I would like to show the values of Subtraction in my plot. The range of the data is [0,1].

But when I plot it, I get in my legend values between 0-25. I don't understand where this values are coming from.

Am I plotting the right values? What is happening to my scales?

A snapshot of the plot created with this command can be seen here.

Thanks for any help,

Tomas

legend ggplot • 2.6k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 3156 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6