Heatmap.2 Error In Plot.new Figure Margins Too Large
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow error in plot.new() figure margins too large rstudio the company Business Learn more about hiring developers or posting ads with us Stack
R Figure Margins
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of increasing the size of the plots pane. 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error in plot.new() : figure margins too large in R up vote 50 down vote favorite 18
Heatmap.2 Margins
I'm new to R but I've made numerous correlation plots with smaller data sets. However, when I try to plot a large dataset (2gb+), I can produce the plot just fine, but the legend doesn't show up. Any advice? or alternatives? > library(gplots) > r.cor <- cor(r) > layout(matrix(c(1,1,1,1,1,1,1,1,2,2), 5, 2, byrow = TRUE)) > par(oma=c(5,7,1,1)) > cx <- rev(colorpanel(25,"yellow","black","blue")) > leg <- seq(min(r.cor,na.rm=T),max(r.cor,na.rm=T),length=10) > image(r.cor,main="Correlation plot Normal/Tumor data",axes=F,col=cx) > axis(1, at=seq(0,1,length=ncol(r.cor)), increasing the size of the plots pane rstudio labels=dimnames(r.cor)[[2]], + cex.axis=0.9,las=2) > axis(2,at=seq(0,1,length=ncol(r.cor)), labels=dimnames(r.cor)[[2]], + cex.axis=0.9,las=2) > image(as.matrix(leg),col=cx,axes=T) Error in plot.new() : figure margins too large > tmp <- round(leg,2) > axis(1,at=seq(0,1,length=length(leg)), labels=tmp,cex.axis=1) r plot share|improve this question edited Oct 7 '12 at 10:03 Gavin Simpson 105k13209304 asked Oct 7 '12 at 4:37 Steve Hwang 3941511 1 You should provide us with a reproducible example demonstrating ills you're having. stackoverflow.com/questions/12765668/… –Roman Luštrik Oct 7 '12 at 8:34 add a comment| 11 Answers 11 active oldest votes up vote 40 down vote accepted I suspect the problem is that the small figure region 2 created by your layout() call is not sufficiently large enough to contain just the default margins, let alone a plot. Before the line causing the problem try: par(mar = rep(2, 4)) then plot the second image image(as.matrix(leg),col=cx,axes=T) You'll need to play around with the size of the margins on the par() call I show to get this right. You may also need to increase the size of the actual device onto which you are plotting. A final tip, save the par() defaults before changing them, so change your existing par() call to: op <- par(oma=c(5,7,1,1)) then at the end of plotting do par(op) share|improve this answer edited Oct 7 '12 at 10:02 answered Oct 7 '12 at 8:38
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more
Heatmap.2 Lwid
about Stack Overflow the company Business Learn more about hiring developers or posting ads
Par(mar = Rep(2, 4))
with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow error in plot.new() : plot region too large is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error in plot.new() : figure margins too large, Scatter plot up vote 21 http://stackoverflow.com/questions/12766166/error-in-plot-new-figure-margins-too-large-in-r down vote favorite 11 I've looked in different questions for a solution and I've tried what was suggested but I have not found a solution to make it work. Everytime I want to run this code it always says: Error in plot.new() : figure margins too large and I don't know how to fix it. Here is my code: par(mfcol=c(5,3)) hist(RtBio, main="Histograma de Bio Pappel") boxplot(RtBio, main="Diagrama de Caja http://stackoverflow.com/questions/23050928/error-in-plot-new-figure-margins-too-large-scatter-plot de Bio Pappel") stem(RtBio) plot(RtBio, main="Gráfica de Dispersión") hist(RtAlsea, main="Histograma de Alsea") boxplot(Alsea, main="Diagrama de caja de Alsea") stem(RtAlsea) plot(RtTelev, main="Gráfica de distribución de Alsea") hist(RtTelev, main="Histograma de Televisa") boxplot(telev, main="Diagrama de Caja de Televisa") stem(Telev) plot(Telev, main="Gráfica de dispersión de Televisa") hist(RtWalmex, main="Histograma de Walmex") boxplot(RtWalmex, main="Diagrama de caja de Walmex") stem(RtWalmex) plot(RtWalmex, main="Gráfica de dispersión de Walmex") hist(RtIca, main="Histograma de Ica") boxplot(RtIca, main="Gráfica de caja de Ica") stem(RtIca) plot(RtIca, main="Gráfica de dispersión de Ica") What can I do? r plot figure margins share|improve this question edited May 2 at 18:43 lmo 11.6k81739 asked Apr 14 '14 at 2:14 user3530361 111114 1 the related questions to the right is maxed out with the same question. you didn't look very hard –rawr Apr 14 '14 at 2:23 possible duplicate of Error in plot.new() : figure margins too large in R –Calimo Feb 6 '15 at 8:40 1 Margins appear to be too large for your image. This can happen if you have a small plot window. In any case, your description is insufficient to diagnose the problem. We could use a reproducible example or screenshot of your R session with the plot window. –Roman Luštrik Feb 6 '15 at 9:49 add a com
Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Error in plot.new() : figure margins too large http://r.789695.n4.nabble.com/Error-in-plot-new-figure-margins-too-large-td4635651.html Hello All, I am running the following code in RStudio, and I keep on getting an error message that says: "Error in plot.new() : figure margins too large" Is there something that I am doing wrong? # Import Data nba <- read.csv("http://datasets.flowingdata.com/ppg2008.csv", sep=",") nba #Sort Data (sorting by Points, but could be sorting by any other variable) nba <- nba[order(nba$PTS),] error in #Prepare Data: makes rows by player name instead of Row Number row.names(nba) <- nba$Name #Prepare Data: don't need first column anymore, so we get rid of it nba <- nba[,2:20] #Prepe Data: change data from a data frame to a data matrix nba_matrix <- data.matrix(nba) #Create Heat Map nba_heatmap <- heatmap(nba_matrix, Rowv=NA, Colv=NA, col = cm.colors(256), scale="column", margins=c(5,10)) Karly Harrod LBNL error in plot.new Summer Intern [hidden email] Lawrence Berkeley National Laboratory [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code. John Kane Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: Error in plot.new() : figure margins too large Your code works okay in a plan R terminal. It may be an Rstudio problem or perhaps you already have a graphics device open and are trying to draw into it? John Kane Kingston ON Canada > -----Original Message----- > From: [hidden email] > Sent: Fri, 6 Jul 2012 10:39:41 -0700 > To: [hidden email] > Subject: [R] Error in plot.new() : figure margins too large > > Hello All, > > I am running the following code in RStudio, and I keep on getting an > error message that says: "Error in plot.new() : figure margins too > large" > Is there something that I am doing wrong? > > > # Import Data > nba <- read.csv("http://datas