Displaying 20 results from an estimated 40000 matches similar to: "plot help"
2007 Dec 31
3
stack charts right on top of each other
Hi,
I tried to stack two charts on top of each other using the following
R functions:
par(mfrow=c(2,1))
plot(rnorm(1:3),xaxt="n",xlab="")
plot(rnorm(1:3))
This created two charts, one on top of the other, but there is too much
space between them. Does anyone know how to elimiate the space in between
the charts?
Thanks,
--
Tom
[[alternative HTML version deleted]]
2012 Nov 19
3
Plot Area Dimensions
Dear colleagues,
I wish to create a figure with 6 plots arranged vertically with no spacing
between them as they all have a common x-axis.
However, using the code below I'm unable to get the plot area the same size
for each plot.
The bottom plot with the x-axis label is smaller than the others, as is the
top plot which has larger margins.
How can I get the plot region the same size for
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
2007 Oct 24
2
Graphics - plotting two graphs
Hi,
I wanted to plot 2 lines on a single graph. Each graph has one axis that can be common. The code that I'm using is:
-------------------------------------------------------
par(mfrow=c(1, 1))
x1 <- c(2, 4, 6, 8, 10, 12)
x2 <- c(10, 20, 30, 40, 50, 60)
y1 <- c(10,12,15,22,34,21)
y2 <- c(40, 130, 150, 145, 40, 30)
par(las=1, mar=c(4, 4, 2, 4))
plot.new()
How to plot 2 continous variables on double y-axis with 2 factors: ggplot2, gplot, lattice, sciplot?
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 =
2006 Oct 15
2
Compact presentation of multiple figures
Dear r-helpers,
I have six panels: op(par(mfrow = c(2, 3), xaxt = 'n', yaxt = 'n',
pty = 's').
Each of them has a variable main = 'i', and xlab = '', ylab = ''
I would like to achieve two things:
(1) a common x-axis label under panel 5, and one label to the left of
panels 1 and 4
(2) minimal space between the panels.
I have looked for
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',
2013 Mar 26
6
How do I show real values on a log10 histogram
Hi,
I have a histogram with values logged to the base 10
hist(log10(x),breaks=60)
How do I show the log values on the x-axis and a second x-axis showing the
real values?
Thanks
--
Shane
[[alternative HTML version deleted]]
2007 Oct 17
3
how to repeat the results of a generated probabilities
hello,
I want to simulate 200 times the mean of a joint probability (y1) and 200
times the mean of another joint distribution (y2),
that is I'm expecting to get 200 means of y1 and 200 means of y2.
y1 and y2 are probabilities that I calculate from the marginal prob. (z1 and
z2 respectively) multiple by the conditional prob. (x1 and x2 respectively),
which I generaterd from the binomial
2007 Feb 24
1
Making two lines graph ...
Hello!
Can anyone help me to build a graph with the alphanumeric values on
x-axis, with two lines (preferably doted and solid, or similar) that
present values on y-axes. In a toy example, data frame could be like
this:
x.orig x.num y1 y2
a 1 0.2 0.4
b 2 0.1 0.1
c 3 0.3 0.3
d 4 0.3 0.15
e 5 0.1 0.05
I can make graph only if I use values converted to numeric in "x.num",
but not original
2005 Feb 21
4
49 histograms on one page
Hi,
I want to do something like this:
par(mfrow=c(7,7))
for (i in 1:49)
hist(RATDACOM[SUBJNO==i],breaks=0.5+(0:6),
main="",xlab="",ylab="",xaxt="n",yaxt="n")
(Don't think about what RATDACOM and SUBJNO are.)
I get an error
Error in plot.new() : Figure margins too large.
36 histograms with mfrow=c(6,6) work.
But the 36 histograms
2009 Apr 26
2
Conditional plot labels
Hi all,
I'm trying to do multiple graphs in a window like this:
___ ___ ___
ylab |__| |__| |__|
___ ___ ___
ylab |__| |__| |__|
___ ___ ___
ylab |__| |__| |__|
xl xl xl
If I try to put the labels manually, some graphs become smaller than
other and the output is really ugly.
In the thread title I put the word
2008 Feb 27
4
plot y1 and y2 on one graph
Dear all
I have a code like
x<-1:10
y1<-x+runif(10)*2
y2<-seq(0,50,length.out=10)+rnorm(10)*10
par(mfrow=c(1,2))
plot(y1~x)
plot(y2~x)
Now I would like to plot y1 and y2 on the same graph, with its two scales
(y1 on left and y2 on rigth side).
Any help are welcome.
Kind regards
Miltinho
Brazil
[[alternative HTML version deleted]]
2012 Aug 22
3
Barplot with Secondary axis
Hi all,
I am trying to plot a bar chart and trying to plot a line as a secondary
axis as my scale is different for two y axis.
I am plotting a clustered bar chart by using besides = True option in
barplot function and my y coordinates are not plotted exactly at the center
on each two bars. Please help me.
I am pasting the code as follows.
x =
2008 Apr 03
3
summary(object, test=c("Roy", "Wilks", "Pillai", ....) AND ellipse(object, center=....)
Dear All,
I would be very appreciative of your help with the following
1). I am running multivariate multiple regression through the manova() function (kindly suggested by Professor Venables) and getting two different answers for test=c("Wilks","Roy","Pillai") and tests=c("Wilks","Roy",'"Pillai") as shown below. In the
2012 Oct 14
1
Efficient method: Equality of all elements of two vectors
n=10
x1<-(1:n)/n
y1<-rnorm(n,x1^2,1)
m=20
x2<-(1:m)/m
The value of y2 will be rnorm (m, x2^2,1) if none of the elements of x2 is same as x1, but for every same elements in x1 and x2, the value of y2 will be same as y1. I know the following is correct, but for large vectors, this won't work efficiently as this is taking longer time. Can you please let me know how to write the
2006 Jul 18
3
Test for equality of coefficients in multivariate multiple regression
Hello,
suppose I have a multivariate multiple regression model such as the
following:
> DF<-data.frame(x1=rep(c(0,1),each=50),x2=rep(c(0,1),50))
> tmp<-rnorm(100)
> DF$y1<-tmp+DF$x1*.5+DF$x2*.3+rnorm(100,0,.5)
> DF$y2<-tmp+DF$x1*.5+DF$x2*.7+rnorm(100,0,.5)
> x.mlm<-lm(cbind(y1,y2)~x1+x2,data=DF)
> coef(x.mlm)
y1 y2
(Intercept)
2008 Aug 05
1
I have an array of plots and I would like to put a title on the whole array.
Hi, all,
Does anyone know of a way to get a title on an array of plots? I have
tried to use title, mtext, and text to get the title on the array, but
to no avail. I would like something like the following.
title("Big Array")
par(mfrow=c(2,4))
plot(x1,y1)
plot(x2,y2)
..
..
..
Much appreciated,
Art
2008 Aug 15
6
continuous coloring of a polygon
R2.7.1, WinXP
Hi,
I have a polygon inside a circle as follows:
radius <- 3
x <- seq(-radius,radius,length=2000)
y <- sqrt(radius^2-x^2)
xx <- c(x,-x)
yy <- c(y,-y)
plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l",
ylab="", xlab="", axes=F)
radius <- 2.7
x1 <- seq(-radius,radius,length=2000)
y1 <- sqrt(radius^2-x1^2)
2006 Sep 28
3
complex plots using layout()
Dear r-help,
I am trying to plot several scatter plots with marginal histograms on
one page. Ideally, a page is equally divided into 4 figure regions.
Within each figure region, a scatter plot with marginal histograms will
be plotted.
I followed Dr. Paul Murrell's code released online to successfully plot
the scatter plot with marginal histograms. The code applies "layout()"
to