[R] Error in plot.new() : figure margins too large

John Kane jrkrideau at inbox.com
Fri Jul 6 20:02:27 CEST 2012


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: kharrod at lbl.gov
> Sent: Fri, 6 Jul 2012 10:39:41 -0700
> To: r-help at r-project.org
> 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://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),]
> 
> #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 Summer Intern
> kharrod at lbl.gov
> Lawrence Berkeley National Laboratory
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!



More information about the R-help mailing list