Hi:
My guess is that you failed to set panel.grid.major to element_blank()
in *both* the x- and y-directions, but since you supplied neither the
data nor the code that produced thm[[1]], it's impossible to confirm
or disconfirm the guess.
Dennis
On Tue, Mar 19, 2013 at 11:45 AM, Francisco Zambrano <
frza...@gmail.com> wrote:
> Hello everyone
>
> I have a problem creating a hetmap with package ggplot, in this case I use a
> data frame with values of a drought index for each unit (administrative
> unit) vs time (each 16 days between 2000-2012). The problems is that when I
> use time in the y axis appear horizontal white lines that makes my plot
> looks ugly.
>
> Here is the link to the finall figure
>
http://2.bp.blogspot.com/-Hnc1C1GiDg0/UUcboy5M1DI/AAAAAAAAEnk/RdvJ6tPRfcc/s1600/heatmap_vci.png
>
> The code is as follows
>
> ggplot(df.m, aes(variable,dates)) +
> geom_raster(aes(fill = value)) +
> scale_fill_gradient2(low="darkred", mid="yellow",high="darkgreen",
> limits=c(0,100), midpoint =
> 50,breaks=c(0,10,20,30,40,50,60,70,80,90,100))+
> scale_y_datetime(breaks = date_breaks("3 months"),labels =
> date_format("%b-%Y")) +
> scale_x_discrete(expand=c(0,0))+
> thm[[1]]+theme_bw()
>
> where thm[[1]] is:
>
>
>> thm[[1]]
> List of 10
> $ axis.title :List of 8
> ..$ family : NULL
> ..$ face : NULL
> ..$ colour : NULL
> ..$ size : num 15
> ..$ hjust : NULL
> ..$ vjust : NULL
> ..$ angle : NULL
> ..$ lineheight: NULL
> ..- attr(*, "class")= chr [1:2] "element_text" "element"
> $ axis.text.x :List of 8
> ..$ family : NULL
> ..$ face : NULL
> ..$ colour : NULL
> ..$ size : num 10
> ..$ hjust : num 1
> ..$ vjust : NULL
> ..$ angle : num 90
> ..$ lineheight: NULL
> ..- attr(*, "class")= chr [1:2] "element_text" "element"
> $ axis.text.y :List of 8
> ..$ family : NULL
> ..$ face : NULL
> ..$ colour : NULL
> ..$ size : num 10
> ..$ hjust : NULL
> ..$ vjust : NULL
> ..$ angle : NULL
> ..$ lineheight: NULL
> ..- attr(*, "class")= chr [1:2] "element_text" "element"
> $ legend.key : list()
> ..- attr(*, "class")= chr [1:2] "element_blank" "element"
> $ legend.key.width: NULL
> $ legend.text :List of 8
> ..$ family : NULL
> ..$ face : NULL
> ..$ colour : NULL
> ..$ size : num 10
> ..$ hjust : NULL
> ..$ vjust : NULL
> ..$ angle : NULL
> ..$ lineheight: NULL
> ..- attr(*, "class")= chr [1:2] "element_text" "element"
> $ legend.title : list()
> ..- attr(*, "class")= chr [1:2] "element_blank" "element"
> $ legend.position : chr "none"
> $ legend.direction: chr "horizontal"
> $ panel.grid.major: list()
> ..- attr(*, "class")= chr [1:2] "element_blank" "element"
> - attr(*, "class")= chr [1:2] "theme" "gg"
> - attr(*, "complete")= logi FALSE
>
> --
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
>
https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email
ggp...@googlegroups.com
> To unsubscribe: email
ggplot2+u...@googlegroups.com
> More options:
http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ggplot2+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>