--
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
--
Brian S. Diggs, PhD
Senior Research Associate, Department of Surgery
Oregon Health & Science University
ggplot2More options:http://groups.google.com/group/ggplot2
--
You received this message because you are subscribed to the
http://gist.github.com/270442mailing list.
Please provide a reproducible example:
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+unsubscribe@googlegroups.com
More options:http://groups.google.com/group/ggplot2
--
You received this message because you are subscribed to the
ggplot2
http://gist.github.com/270442mailing list.
Please provide a reproducible example:
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+unsubscribe@googlegroups.com
More options:http://groups.google.com/group/ggplot2
--
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+unsubscribe@googlegroups.com
More options:http://groups.google.com/group/ggplot2
--
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+unsubscribe@googlegroups.com
More options: http://groups.google.com/group/ggplot2
--
Brian S. Diggs, PhD
Senior Research Associate, Department of Surgery
Oregon Health & Science University
--
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+unsubscribe@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Breaks define which values are displayed on the scale but, in principle,
should not affect the mapping between data and aesthetic (the displayed
scale being the graphical representation of the reverse mapping from
aesthetic to data). I think.
I figured this out looking at the examples at
http://had.co.nz/ggplot2/scale_gradientn.html
> Brandon
>
> On Tue, Nov 1, 2011 at 23:29, Brian Diggs<diggsb-k1...@public.gmane.org> wrote:
>
>> ggplot(z, aes(variable, Gene_Symbol)) +
>> geom_tile(aes(fill=value)) +
>> scale_fill_gradientn(colour = c("darkgreen", "white", "white", "white",
>> "darkred"), values=c(-5, -1.5, 0, 1.3, 5), rescale=FALSE,
>>
>> breaks= c(-5, -1.3, 0, 1.3, 5))
>>
>> On 11/1/2011 3:17 PM, Brandon Hurr wrote:
>>
>>> In other words, it's ignoring your breaks. It shouldn't be doing that as
>>> far as I know. Perhaps Hadley or Takahashi know why?
>>>
>>> B
>>>
>>>>> On Tue, Nov 1, 2011 at 01:45, CK<combizkhoz...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>>>>>>
>>>>>>>>> wrote:
>>>>
>>>>> Hi thanks for your reply. I've taken a look at
>>>>>>>>>>>
>>>>>>>>>> scale_gradientn()
>>>>
>>>>> and
>>>>>>>
>>>>>>>> it looks promising but I'm not quite getting the results I
>>>>>>>>>>>
>>>>>>>>>> would
>>>>
>>>>> like
>>>>>>>
>>>>>>>> yet. Here's what I have: -
>>>>>>>>>>>
>>>>>>>>>>
>>>>> breaks = c(-5, -1.3, 0, 1.3, 5)
>>>>>>>>>>> mycolours = c("green", "grey50", "white", "grey50", "red")
>>>>>>>>>>>
>>>>>>>>>>
>>>>> p<- ggplot(z, aes(variable, Gene_Symbol)) +
>>>>>>>>>>> geom_tile(aes(fill=value)) +
>>>>>>>>>>> scale_fill_gradientn(colour = mycolours, breaks=breaks,
>>>>>>>>>>> labels=format(breaks))
>>>>>>>>>>> p
>>>>>>>>>>>
>>>>>>>>>>
>>>>> The result is a heatmap that appears mostly green, not quite
>>>>>>>>>>>
>>>>>>>>>> what
>>>>
>>>>> was
>>>>>>>
>>>>>>>> intended.
>>>>>>>>>>>
>>>>>>>>>>
>>>>> Thanks for any suggestions.
>>>>>>>>>>>
>>>>>>>>>>
>>>>> On Oct 29, 10:00 am, Brandon Hurr<brandon.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>>>>>>>
>>>>>>>>>> wrote:
>>>>
>>>>> I think you might be able to get what you want with
>>>>>>>>>>>>
>>>>>>>>>>> scale_gradientn().
>>>>>>>>>
>>>>>>>>>> You
>>>>>>>>>>>
>>>>>>>>>>>> can specify more breaks that way and keep the middle of
>>>>>>>>>>>>
>>>>>>>>>>> your data
>>>>
>>>>> more
>>>>>>>>>
>>>>>>>>>> white.
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>> On Fri, Oct 28, 2011 at 23:29, CK<combizkhoz...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>> wrote:
>>>>>>>
>>>>>>>> I'm trying to produce a heatmap of values with the
>>>>>>>>>>>>>
>>>>>>>>>>>> following
>>>>
>>>>> color
>>>>>>>
>>>>>>>> gradient ranges: -
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>> Low, -1.3 to -5, increasing green peaking at -5
>>>>>>>>>>>>> Mid,>-1.3 to<1.3, White
>>>>>>>>>>>>> High, 1.3 to 5, increasing red peaking at 5
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>> The closest I can get is: -
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>> p<- ggplot(z, aes(variable, Gene_Symbol)) +
>>>>>>>>>>>>> geom_tile(aes(fill=value)) +
>>>>>>>>>>>>> scale_fill_gradient2(limits=c(**-5, 5), midpoint=0, low =
>>>>>>>>>>>>> muted("green"), mid="white", high = muted("red"))
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>> This is quite close, however all values<0 are red and
>>>>>>>>>>>>>
>>>>>>>>>>>> all
>>>>
>>>>> values
>>>>>>>
>>>>>>>> 0
>>>>>>>>>>
>>>>>>>>>>> are green. Is there a way to specify a midpoint range
>>>>>>>>>>>>>
>>>>>>>>>>>> (i.e.
>>>>
>>>>> -1.3
>>>>>>>>
>>>>>>>>> and
>>>>>>>>>
>>>>>>>>>> <1.3) rather than a single value? If not, is there any
>>>>>>>>>>>>>
>>>>>>>>>>>> other
>>>>
>>>>> way
>>>>>>>
>>>>>>>> to
>>>>>>>>>
>>>>>>>>>> get this result?
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>> Thanks
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>> --
>>>>>>>>>>>>> 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 ggplot2-/JYPxA39Uh5...@public.gmane.org
>>>>>>>>>>>>> To unsubscribe: email
>>>>>>>>>>>>>
>>>>>>>>>>>> ggplot2+unsubscribe@**googlegroups.com<ggplot2%2Bunsubscribe-/JYPxA39Uh5...@public.gmane.org>
>>>>
>>>>> More options:http://groups.google.**com/group/ggplot2<http://groups.google.com/group/ggplot2>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>> --
>>>>>>>>>>> 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 ggplot2-/JYPxA39Uh5...@public.gmane.org
>>>>>>>>>>> To unsubscribe: email ggplot2+unsubscribe@**googlegroups.com<ggplot2%2Bunsubscribe-/JYPxA39Uh5...@public.gmane.org>
>>>>>>>>>>> More options:http://groups.google.**com/group/ggplot2<http://groups.google.com/group/ggplot2>
>>>>>>>>>>>
>>>>>>>>>>
>>>>> --
>>>>>>>>> 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 ggplot2-/JYPxA39Uh5...@public.gmane.org
>>>>>>>>> To unsubscribe: email ggplot2+unsubscribe@**googlegroups.com<ggplot2%2Bunsubscribe-/JYPxA39Uh5...@public.gmane.org>
>>>>>>>>> More options:http://groups.google.**com/group/ggplot2<http://groups.google.com/group/ggplot2>
>>>>>>>>>
>>>>>>>>
>>>>> --
>>>>>>> You received this message because you are subscribed to the ggplot2
>>>>>>> mailing list.
>>>>>>> Please provide a reproducible example:http://gist.github.**com/270442<http://gist.github.com/270442>
>>>>>>>
>>>>>>
>>>>> To post: email ggplot2-/JYPxA39Uh5...@public.gmane.org
>>>>>>> To unsubscribe: email ggplot2+unsubscribe@**googlegroups.com<ggplot2%2Bunsubscribe-/JYPxA39Uh5...@public.gmane.org>
>>>>>>> More options:http://groups.google.**com/group/ggplot2<http://groups.google.com/group/ggplot2>
>>>>>>>
>>>>>>
>>>> --
>>>> 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 ggplot2-/JYPxA39Uh5...@public.gmane.org
>>>> To unsubscribe: email ggplot2+unsubscribe@**googlegroups.com<ggplot2%2Bunsubscribe-/JYPxA39Uh5...@public.gmane.org>
>>>> More options: http://groups.google.com/**group/ggplot2<http://groups.google.com/group/ggplot2>
>>>>
>>>>
>>>
>>
>> --
>> Brian S. Diggs, PhD
>> Senior Research Associate, Department of Surgery
>> Oregon Health& Science University
>>
>>
>> --
>> 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 ggplot2-/JYPxA39Uh5...@public.gmane.org
>> To unsubscribe: email ggplot2+unsubscribe@**googlegroups.com<ggplot2%2Bunsubscribe-/JYPxA39Uh5...@public.gmane.org>
>> More options: http://groups.google.com/**group/ggplot2<http://groups.google.com/group/ggplot2>
Kohske has been working on this,
http://kohske.wordpress.com/2011/04/01/alpha-version-of-colorbar-legend-in-ggplot2/
I'm not sure whether it's now present in the main branch of ggplot2.
baptiste
> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
not sure but maybe you can do like this in the next version:
ggplot(z, aes(variable, Gene_Symbol)) +
geom_tile(aes(fill=value)) +
scale_fill_gradientn(colours = c("darkgreen", "darkgreen",
"white","white", "white", "darkred", "darkred"),
values=c(-50, -4, -1, 0, 1, 4, 50),
rescale = function(x, ...) x, oob = identity) +
guides(fill = guide_colorbar(barheight = 10))
--
Kohske Takahashi <takahash...@gmail.com>
Research Center for Advanced Science and Technology,
The University of Tokyo, Japan.
http://www.fennel.rcast.u-tokyo.ac.jp/profilee_ktakahashi.html
2011/11/6 baptiste auguie <bapt...@googlemail.com>:
2011/11/6 CK <combiz...@gmail.com>:
> Kohske, that legend gradient is indeed a big improvement. I noticed it
> isn't showing the negative (green) values though?
this is because of the range of data.
z$value only include > 1.
If data ranges more broadly, then it looks like this:
z$value <- runif(nrow(z), -20, 20)
will install and load ggplot2 on the temporary directory.
I'm not sure if this works well on Windows.
--
Kohske Takahashi <takahash...@gmail.com>
Research Center for Advanced Science and Technology,
The University of Tokyo, Japan.
http://www.fennel.rcast.u-tokyo.ac.jp/profilee_ktakahashi.html
2011/11/6 CK <combiz...@gmail.com>: