par

Common main title of a figure panel compiled with par(mfrow)

倖福魔咒の 提交于 2019-12-18 10:26:37
问题 I have a compilation of 4 plots drawn together with par(mfrow=c(2,2)) . I would like to draw a common title for the 2 above plots and a common title for the 2 below panels that are centered between the 2 left and right plots. Is this possible? 回答1: This should work, but you'll need to play around with the line argument to get it just right: par(mfrow = c(2, 2)) plot(iris$Petal.Length, iris$Petal.Width) plot(iris$Sepal.Length, iris$Petal.Width) plot(iris$Sepal.Width, iris$Petal.Width) plot

Histogram, error: Error in plot.new() : figure margins too large [duplicate]

点点圈 提交于 2019-12-13 13:45:19
问题 This question already has answers here : Error in plot.new() : figure margins too large in R (13 answers) Closed 4 years ago . I have to plot 141 histograms in R. I am working with windows 8. then I write: par(mfcol=c(12,12), oma=c(1,1,0,0)) for(m in 1:141 ){ x <- precData[[m]] hist(x[x != 0],30, xlab=NA, ylab=NA, main=statData$Name[m]) } But always I get this error: Error in plot.new() : figure margins too large How can I solve it?? Is there any command for adjusting the size of each

PHP HTML DOM to parse XML second result

一个人想着一个人 提交于 2019-12-13 01:34:38
问题 I'm using simple PHP HTML DOM to parse XML, it is that there are several tags with the same values​​, how I can display only the second label? 回答1: I'm guessing from your question you're using PHP Simple HTML DOM? http://simplehtmldom.sourceforge.net/ You should be able to get the second label by doing something like: // $xml is your DOM object $tags = $xml->find("label"); echo $tags[1]; If you're not using PHP Simple HTML DOM, let us know which you're using, as it'll be different depending

Installing PAR::Packer on Windows, dmake error 255

柔情痞子 提交于 2019-12-11 00:08:26
问题 I am trying to create a binary of a perl script for Windows, and I cannot afford commercial applications such as perl2exe and Active Perl Dev Kit (I am aware there are trial versions). Because of this I have installed strawberry perl on a Windows XP SP3 32bit Virtual Machine to try and compile my source file; something that I was easily able to do on Linux. Strawberry perl installs fine however when I try to install the PAR::Packer module from cpan, I get the following errors: dmake: Error

mtext: smaller labels description when layout is used

爷,独闯天下 提交于 2019-12-08 03:52:48
问题 Using mtext for the label description does something different than using xlab. How can I make the mtext labels be always the same size as it would be when using xlab (without defining always the cex argument). In the minimal example below cex=cex.lab=1 for both figures. However the size is different. layout(matrix(c(1,1,2,2), ncol=1)) op<-par(mar=c(4,4,2,1)) plot(1:10, xlab="", ylab="", main="This is my title") mtext("this is the x-axis", side=1, line=2.75, cex=1) mtext("this is the y-axis",

Add the new regression line but keep the regression lines from previous runs in R

て烟熏妆下的殇ゞ 提交于 2019-12-08 03:31:11
问题 Background I have a function called TPN ( R code is below the picture ). When you run this function, it produces two plots ( see picture below ). The bottom-row plot samples from the top-row plot and then adds a red regression line. Each time you run the TPN function, the bottom-row plot produces a new red-colored regression line . Question In the bottom-row plot , I was wondering if there is a way I could KEEP the regression lines from previous runs each time I run the TPN function ( see

mtext: smaller labels description when layout is used

China☆狼群 提交于 2019-12-07 02:51:26
Using mtext for the label description does something different than using xlab. How can I make the mtext labels be always the same size as it would be when using xlab (without defining always the cex argument). In the minimal example below cex=cex.lab=1 for both figures. However the size is different. layout(matrix(c(1,1,2,2), ncol=1)) op<-par(mar=c(4,4,2,1)) plot(1:10, xlab="", ylab="", main="This is my title") mtext("this is the x-axis", side=1, line=2.75, cex=1) mtext("this is the y-axis", side=2, line=2.5, cex=1) plot(1:10, xlab="this is smaller", ylab="this is smaller", main="This is my

Add the new regression line but keep the regression lines from previous runs in R

∥☆過路亽.° 提交于 2019-12-06 12:36:27
Background I have a function called TPN ( R code is below the picture ). When you run this function, it produces two plots ( see picture below ). The bottom-row plot samples from the top-row plot and then adds a red regression line. Each time you run the TPN function, the bottom-row plot produces a new red-colored regression line . Question In the bottom-row plot , I was wondering if there is a way I could KEEP the regression lines from previous runs each time I run the TPN function ( see picture below )? That is, each time that I run a new TPN function the regression line from a previous run

How do I jitter the node split strings in plotting ctree output from partykit?

最后都变了- 提交于 2019-12-06 01:39:59
问题 I have an issue where I am using mainly categorical data, set to a class of factor, in a classification tree. I am using the partykit package in R and not party as previous answers here suggested that the former package is better for manipulation of graphics output. I do not have many nodes (about 7) in my real dataset, but I have quite a few factor levels for some variables and I am encountering the issue that the factor levels on the left side of the split and those from the right side are

Centring legend below two plots in r

你说的曾经没有我的故事 提交于 2019-12-03 21:16:45
I would like to centre a common legend below two plots. I have used xpd=TRUE to allow for printing outside the plot itself and oma to create space for the legend. However the legend will not move horizonatally and gets clipped 'early' vertically. Any advice? quartz(title="PCoA",12,6) par(mfrow=c(1,2),oma=c(5,0,0,0),xpd=TRUE) plot(1:3,4:6,main="plot 1") plot(1:3,4:6,main="plot 2") # Clips the plot legend(1,3.5,ncol=3,c("0-1 km","1-5 km","outside barrier"),fill=c("green","orange","red"), title="Fetch") # Won't let me move the legend sideways legend(0,3.5,ncol=3,c("0-1 km","1-5 km","outside