Note that there are some explanatory texts on larger screens.

plurals
  1. POplotting heatmaps with ggplot2; logscale color and modify color legend
    primarykey
    data
    text
    <p>I am trying to create a heatmap with <code>ggplot2</code> (you see the code below) Now there are two things i want to change:</p> <ol> <li>I plot pValues (which are hopefully very small) so i want plot the colors logscale. i tried trans="log" in different variations, but none of them worked</li> <li><p>I want to show more than 6 values in the legend. i tried e.g. breaks, labels for that but this didn't work as well</p> <pre><code>(p &lt;- ggplot(dataPVal.m, aes(variable, structure)) + geom_tile(aes(fill = pValue), colour = "white") + scale_colour_gradientn(colour = rainbow(100), breaks = c(1,2,3,4,5,6), labels =c("a","b","c","d","e","f")) + theme_grey(base_size = base_size) + labs(x = "position (0=seed start)",y = "structure") + ## labels #scale_x_discrete(expand = c(0.01, 0.01)) + ## grauer rand oben/unten #scale_y_discrete(expand = c(0.01, 0.01)) + ## grauer rand links/rechts opts(title=plot_title,legend.position = "left",axis.ticks = theme_blank(), axis.text.x = theme_text(size = base_size * 0.8, angle = 330, hjust = 0, colour = "grey50")) ) </code></pre></li> </ol> <p>here is an example for the pValue-table (dataPVal.m):</p> <pre> structure variable value pValue 1 CB -10 1.00000000 1.00000000 2 BB -10 1.00000000 1.00000000 3 SC -10 0.34700205 0.34700205 4 GC -10 1.00000000 1.00000000 5 BC -10 1.00000000 1.00000000 6 SG -10 0.44494198 0.44494198 7 JG -10 1.00000000 1.00000000 8 IG -10 1.00000000 1.00000000 9 HG -10 1.00000000 1.00000000 10 CG -10 1.00000000 1.00000000 11 HH -10 1.00000000 1.00000000 12 GH -10 0.34375000 0.00000025 13 SI -10 0.25000000 0.25000000 14 JI -10 0.40359735 0.40359735 15 II -10 1.00000000 1.00000000 16 GI -10 1.00000000 1.00000000 17 SJ -10 0.53296021 0.53296021 18 IJ -10 1.00000000 1.00000000 19 GJ -10 1.00000000 1.00000000 20 US -10 0.19567557 0.19567557 21 SS -10 0.43017585 0.00000032 22 JS -10 1.00000000 1.00000000 23 IS -10 1.00000000 1.00000000 24 GS -10 1.00000000 1.00000000 25 CS -10 1.00000000 1.00000000 26 UU -10 0.39863089 0.39863089 27 SU -10 0.50000000 0.50000000 28 JU -10 1.00000000 1.00000000 29 CB -9 0.34944171 0.34944171 30 BB -9 1.00000000 1.00000000 31 SC -9 0.53230531 0.53230531 </pre> <p>is there anybody with a solution for this 2 problems?</p> <p>thx so long</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload