2

I have produced the following graph: enter image description here

Now i have the problem is that the names in the grey area above and on the left, are making the graph confusing so i need to remove them. is there a easy way to do this? like ylab() or xlab().

the data I'm using looks like this:

structure(list(Mash_pear = c(0.328239947270445, 0.752207607551684, 0.812118104861163, 0.640824971449627, 0.615568052052443, 0.546635339103089, 0.557460706464288, 0.650480192893698, 0.418044504894929, 0.52962586938499, 0.727805116980878, 0.457751406173336, 0.429785015765779, 0.395830424689082, 0.442222743260579, 0.296983456365718, 0.80883682959008, 0.81208596690244, 0.710216015384062, 0.773625942359682), tRap_pear = c(0.0350096175177328, 0.234255507711743, 0.23714999195134, 0.185536020521134, 0.191585098617356, 0.201402054387186, 0.220911538536031, 0.216072802572045, 0.132247101763063, 0.172753098431029, 0.280795579672784, 0.188134155907737, 0.217454200485912, 0.0696965676717436, 0.233870791415384, 0.0544299934337156, 0.226678897883402, 0.128806853122092, 0.117478493999246, 0.161184511733104), Beeml_pear = c(0.179209909971615, 0.79129167285928, 0.856908302056589, 0.729078080521886, 0.709346164378725, 0.669599784720647, 0.585348196746785, 0.639355942917055, 0.544909349368496, 0.794652394149651, 0.863422091668162, 0.595508977637756, 0.533923256060852, 0.843786110234149, 0.402095177866003, 0.293984533306754, 0.867067527220569, 0.883565060756018, 0.727331622602897, 0.860485005688852), Mash_pear50 = c(0.192474082559755, 0.679726904159742, 0.778564545349054, 0.573745352397321, 0.56633658385284, 0.472559997318901, 0.462635414367878, 0.562128414492567, 0.354624921832056, 0.64532681437697, 0.699503386816393, 0.384318378224603, 0.366299448984722, 0.46938310547208, 0.282831366512569, 0.227004236832775, 0.754840213343737, 0.763285417222461, 0.638421127411269, 0.719475286983103)), .Names = c("Mash_pear", "tRap_pear", "Beeml_pear", "Mash_pear50"), row.names = c("Aft1", "Alx3_3418.2", "Alx4_1744.1", "Arid3a_3875.1_v1_primary", "Arid3a_3875.1_v2_primary", "Arid3a_3875.2_v1_primary", "Arid3a_3875.2_v2_primary", "Arid5a_3770.2_v1_primary", "Arid5a_3770.2_v2_primary", "Aro80", "Arx_1738.2", "Ascl2_2654.2_v1_primary", "Ascl2_2654.2_v2_primary", "Asg1", "Atf1_3026.3_v1_primary", "Atf1_3026.3_v2_primary", "Bapx1_2343.1", "Barhl1_2590.2", "Barhl2_3868.1", "Barx1_2877.1"), class = "data.frame") 

and the function i use for plotting:

plotAll<-function(data,size=2, alpha=0.4){ combs <- expand.grid(names(data), names(data)) out <- do.call(rbind, apply(combs, 1, function(x) { tt <- data[, x]; names(tt) <- c("V1", "V2") tt <- cbind(tt, id1 = x[1], id2 = x[2]) })) library(plyr) df.text=ddply(out[out$id1==out$id2,],.(id1,id2),summarise, pos=max(V1)-(max(V1)-min(V1))/2) out[out$id1==out$id2,c("V1","V2")]<-NA out$labels <- rownames(out) out$labels<-sapply(out$labels, function(x){ strsplit(x, "_")[[1]][1] }) fam<-read.table('input/genomic_info_subset.tsv', sep='\t') idx<-match(out$labels,fam$V1) newcol<-fam$V4[idx] newcol<-as.character(newcol) out$fam<-newcol ggplot(data = out, aes(x = V2, y = V1)) + geom_text(data = out[!is.na(out$V1),], aes(label = labels), size=size, alpha=alpha) + facet_grid(id1 ~ id2,scales="fixed")+ geom_text(data=df.text,aes(pos,pos,label=id1)) + geom_abline( slope=1 ) + ggtitle("Corralation between measured & calculated affinities") + ylab("") + xlab("") + theme(panel.grid.minor.x=element_blank(), panel.grid.major.x=element_blank()) #return(out) } 

Maybe its with facet_grid() but cant figure out what to change for the result i want.

1 Answer 1

4

To remove texts from facet strip set strip.text= to element_blank() with theme().

+theme(strip.text=element_blank()) 

To remove also grey area under the text set also strip.background= to element_blank().

+theme(strip.text=element_blank(), strip.background=element_blank()) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.