similar to: Add y-title to a plot with two y axis

Displaying 20 results from an estimated 10000 matches similar to: "Add y-title to a plot with two y axis"

2010 Jan 21
2
(no subject)
Hi is there a way in R to create a new column vector with the numbers of 2 others columns simply appended? Example : I have a column with provinces codes (1 to 19) I have a second column with districts codes (1 to ##, depending on the province) I want to create a third column with a code that would be unique for each district: Province  District   District_Unique 1             1            11
2011 Nov 24
1
Horizontal Y axis title above the y axis
Dear R-help team I have tried hard to turn my Y axis 90 degrees, so that it is written horizontally, and placing it above the Y axis, but I did not succeed. I have tried to adapt the following functions: - plot() - title() - mtext() And some more that did not prove to be useful (e.g. text() etc). The closest I got to my aim was with mtext(): mtext("Yield
2007 Mar 22
1
Labelling a second y-axis
Hi, I am using the following code as an example function to create multiple y-axes on one plot. I have it working fine however, I can't seem to add a label on the second (right) axis. I have tried adding ylab="y2" in the axis call but, that didn't work; any ideas? Thanks, Jesse Code: function() { par(las=1,xaxs="r",mai=c(1,0.75,1,1)) x<-1:10 y1<-x
2009 Dec 15
1
Help in R
Hello, Can anyone give me some suggestion in term of calculating the sum below. Is there a function in R that can help doing it faster? x1, x2, ...xn where xi can be 0 or 1. I want to calculate the following: sum{ beta[a+sum(xi), b+n-sum(xi) ]* [ (1-x1)dnorm(0,1)+x1dnorm(2,1) ]* [ (1-x2)dnorm(0,1)+x2dnorm(2,1) ]* ...* [ (1-xn)dnorm(0,1)+xndnorm(2,1) ] } The sum in the beginning is over all
2003 Apr 10
1
how to estimate parameters of multimodal distribution
Dear all Please, is there any function or package for dealing with multimodal distributions? I try to fit multimodal distribution or more precisely to find out mixture of normal distributions which can lead to my actual data. I use optim to find (in that case) two parameters but what I want is to let the function find out arbitrary number of normal distributions underlaying my actual data
2007 Jun 25
3
How to shadow 'power' area?
Dear all, Suppose I plot two normal distributions (A and B) side by side and add vertical line which hipotheticaly represent alpha value; e.g.: x <- seq(-3.5,5, length=1000) y <- dnorm(x) # Plot distribution A plot(y~x, type='l',axes=F,xlab="",ylab="",lwd=2) # Plot distribution B y2 <- dnorm(x-1.5) lines(y2~x,lwd=2) # Plot vertical line for alpha value
2007 Oct 18
5
Secondary Y axis title
I have the following R code to create a plot with two y axes. I am essentially trying to plot a price series with a volume series on the same graph. (i.e. to compare price with volume). I can label the first y axis successfully, but the problem is in labeling the 2nd y-axis. Essentially, the label never appears. It seems as though there is not enough margin on the right hand side of
2003 Aug 29
1
Six axis y with axis function?
Hi, I am trying to plot a time serie of six colum of data sets on one plot but with using a different y-axis ranges for each - preferably with one shown on each side of the graph. I'm trying with axis function but not good luck i will for each they plot with our proper scale and range for example time A B C...etc 08:00:01 1000 15 2 08:00:02 2200 17 5 08:00:03 2500 19
2007 Feb 23
4
How to plot two graphs on one single plot?
Hi, I am trying to plot two distribution graph on one plot. But I dont know how. I set them to the same x, y limit, even same x, y labels. Code: x1=rnorm(25, mean=0, sd=1) y1=dnorm(x1, mean=0, sd=1) x2=rnorm(25, mean=0, sd=1) y2=dnorm(x2, mean=0, sd=1) plot(x1, y1, type='p', xlim=range(x1,x2), ylim=range(y1, y2), xlab='x', ylab='y') plot(x2, y2, type='p',
2008 May 31
2
How to add space between main title to leave space for legend?
Hello, everybody: I recently encountered an example with in which the graph was placed in a way that did not leave room for a legend. Maybe you would describe it as "legend too big", I'm not sure. I found myself wishing I could force in some space after the title. Here's working example where I'd like to make room for a legend. x <- rnorm(100) hist(x, freq=F,
2013 Feb 25
3
How to plot 2 continous variables on double y-axis with 2 factors: ggplot2, gplot, lattice, sciplot?
Hi, I have a data set with two continous variables that I want to plot MEANS (I am not intrerested in median values) on a double-y graph. I also have 2 factors. I want the factor combinations plotted in different panes. Dummy dataset: mydata <- data.frame(factor1 = factor(rep(LETTERS[1:3], each = 40)), factor2 = factor(rep(c(1:4), each = 10)), y1 =
2003 Nov 07
1
y label after axis (4)
Hi, I am trying to figure out how to lable the second y-axis after the following codes: plot(x, y, xlab="time", ylab="pay1" ) par(new=TRUE) plot(x,y2, ann=FALSE, xaxt="n", yaxt="n", pch=7 ) axis(4) Then, I want to label the second y axis "pay2". I tried "title(ylab="pay2")", but it put this lable on the first
2007 Mar 25
1
eliminating panel borders from lattice plots
I am trying to eliminate panel borders from my lattice plots. By default, they always print. For example: library(lattice) x <- seq(-3,3,length=1000) y1 <- dnorm(x) y2 <- dnorm(x, sd=.5) data <- data.frame(x=rep(x,2), y=c(y,y2), panel=rep(c(1,2), each=1000)) dplot <- xyplot(y~x | panel, data=data, strip=F, scales=list(draw=F))
2010 Jul 06
1
plotmath vector problem; full program enclosed
Here's another example of my plotmath whipping boy, the Normal distribution. A colleague asks for a Normal plotted above a series of axes that represent various other distributions (T, etc). I want to use vectors of equations in plotmath to do this, but have run into trouble. Now I've isolated the problem down to a relatively small piece of working example code (below). If you would
2003 Jul 22
4
greek in main title
Hello, I have written a function that demonstrates the CLT by generating samples following the exponential distribution, calculating the means, plotting the histogram, and drawing the limiting normal curve as an overlay. I have the title of each histogram state the sample size and rate (1/theta) for the exponential (the output is actually 4 histograms), but I can't get the greek letter theta
2012 Feb 23
2
help with winbugs glm
Hi, I am running a model with count data and one categorical predictor (simple model for me to understand it fully), I did in R a glm like this: glm(Recruitment~Depth, family=poisson). I get the coefficientes and confidence intervals and all is ok. But then I want to do the same model with Bayesian stats, here is my code: model { for (i in 1:232) { Recruitment[i]~dpois(lambda[i])
2002 Jan 31
2
Add item to scale?
Hi, many thanks for all suggestions as to shading of areas. Now to another small detail: how do I add items to the x-axis? Given a plot of "dnorm", I'd like to add some text to the x-axis, preferably with a corresponding tick mark. Imagine the typical \lambda demarcating a tail area. So far, I've only been able to add text in the plot region, not in the one of the axes.
2012 Jul 24
4
Integrate(dnorm) with different mean and standard deviation help
I'm trying to provide different parameters to the integrate function for various probability functions. I'm using dnorm as the simplest example here. For instance integrate(dnorm, -1.96, 1.96) produces the correct answer for a normal distribution with mean 0 and standard deviation 1. I've tried two ways to use mean=2.0 and standard deviation 1, but with no luck. The examples follow.
2006 Apr 05
2
R2WinBUGS error
Dear R-help, I'm using the R2WinBUGS package and getting an error message: Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file 'codaIndex.txt', reason 'No such file or directory' I'm using R 2.2.1 and WinBUGS 1.4.1 on a windows machine (XP). My R code and WinBUGS code is given below.
2003 Oct 31
4
dnorm() lead to a probability >1
Howdee, One of my student spotted something I can't explain: a probability >1 vs a normal probability density function. > dnorm(x=1, mean=1, sd=0.4) [1] 0.9973557 > dnorm(x=1, mean=1, sd=0.39) [1] 1.022929 > dnorm(x=1, mean=1, sd=0.3) [1] 1.329808 > dnorm(x=1, mean=1, sd=0.1) [1] 3.989423 > dnorm(x=1, mean=1, sd=0.01) [1] 39.89423 > dnorm(x=1, mean=1, sd=0.001) [1]