How can i change the position of the legend in a MAplot?
1
0
Entering edit mode
7.9 years ago
alcarcar94 • 0

Hello, I am trying to do 6 different MAplots, each one of a different array, but I want that they appear together in one image. I use this command

ArraysName <- c("A", "B", "C", "D", "E", "F")
 par(mfrow= c(3,2))
        for (i in 1:6) {
            plotMA(data, array= i, cex = 0.2, ,ArraysName [i] ))
  }

And it works perfectly, but in the image the legend of each array is very big and it covers part of the data. How can I change the position of the legend or make the legend smaller so that it doesn't cover the array?

MAplot • 2.5k views
ADD COMMENT
0
Entering edit mode

Thank you so much! It worked!

ADD REPLY
2
Entering edit mode
7.9 years ago
Ar ★ 1.1k

use legend = in your function plotMA. For example:

MA <- new("MAList")
MA$A <- runif(300,4,16)
MA$M <- rt(300,df=3)

# Spike-in values
MA$M[1:3] <- 0
MA$M[4:6] <- 3
MA$M[7:9] <- -3

status <- rep("Gene",300)
status[1:3] <- "M=0"
status[4:6] <- "M=3"
status[7:9] <- "M=-3"
values <- c("M=0","M=3","M=-3")
col <- c("blue","red","green")
plotMA(MA,main="MA-Plot with 12 spiked-in points",
       status=status, values=values, hl.col=col, legend = "topleft")

plotMA(MA,main="MA-Plot with 12 spiked-in points",
       status=status, values=values, hl.col=col, legend = "bottomleft")

plotMA(MA,main="MA-Plot with 12 spiked-in points",
       status=status, values=values, hl.col=col, legend = "topright")

plotMA(MA,main="MA-Plot with 12 spiked-in points",
       status=status, values=values, hl.col=col, legend = "bottomright")
ADD COMMENT

Login before adding your answer.

Traffic: 1555 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6