Just guessing, but variable appears to be a factor with one level
(ratio). Since the extent of the tiles appears to be one horizontal
unit in length, perhaps
scale_x_discrete(limits = c(0.5, 1.5), expand = c(0, 0))
would work for you. Is this 0.8.9 or 0.9.0?
Dennis
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
Hi:
Just guessing, but variable appears to be a factor with one level
(ratio). Since the extent of the tiles appears to be one horizontal
unit in length, perhaps
scale_x_discrete(limits = c(0.5, 1.5), expand = c(0, 0))
would work for you. Is this 0.8.9 or 0.9.0?
Maybe you can take this and run with it to get what you want. Instead
of using a one-level factor that is more than capable of messing
things up, I used geom_segment() instead with a numeric x-axis. Here's
a reproducible example with fake data using ggplot2-0.9.0:
tst <- data.frame(idsort = round(runif(1000, 0, 2000), 0),
value = rnorm(1000, 0, 2))
ggplot(tst, aes(y = idsort, colour = value)) +
geom_segment(aes(x = 1, xend = 0, yend = idsort)) +
scale_colour_gradient2(expression(log2(Xrcc2mm/WT)), low="blue",
mid = "white", high="red",
space = "Lab", midpoint = 0, breaks = c(-5,-2,0,2,5)) +
opts(panel.background = theme_blank(), panel.border=theme_blank())
A couple of things you might try since you're using 0.9.0: (i) use
guide_legend() with the aes.override = argument to increase the
thickness of the lines in the legend (but not in the plot itself);
(ii) the x-labels are rather arbitrary and hence superfluous, so you
could get rid of them altogether.
Dennis