Displaying 20 results from an estimated 10000 matches similar to: "can I add to a plot and auto-re-scale axes?"
2005 Mar 17
1
Legend positioning in scaled survival plot
I am sorry that this is another novice question. I am having trouble
using "legend" with the survival curve plot from the survival package,
and I wonder if it is because I have rescaled my plot.
Here is the relevant segment of code:
> plot(survfit(Surv(OS,Status)~shortishcr1),main='Overall Survival by
factor',
+ xlab='Years',ylab='%
2008 May 27
1
Fwd: Re: Seeking help with trellis: log scales on xyplot
Deepayan:
Sorry for the additional email, but I'm concerned that I wasn't being clear.
In the end, I would like a graphic that portrays my y-values on a log scale in their native data range. That is to say, I would prefer to see the axis labels as 1000 rather than 3 (log10 of 1000).
Thank you for your kind assistance,
Hobie Perry
St. Paul, MN
Hobie Perry <hobie_perry@yahoo.com>
2005 Sep 04
1
specification for glmmPQL
Hello All,
I have a question regarding how glmmPQL should be specified. Which of
these two is correct?
summary(fm.3 <- glmmPQL(cbind(response, 100 - response) ~ expt,
data = data.1, random = ~ 1 | subject,
family = binomial))
summary(fm.4 <- glmmPQL(response ~ expt, data = data.2,
random = ~ 1 | subject, family =
2012 Sep 27
3
Comparing density plots using same axes or same axes scale
Good Evening-
I have a set of nine scenarios I want to plot to see how the distribution
is changing, if one tail is getting larger in certain scenario, currently I
am using this code
colnames<-dimnames(sag_pdfs)[[2]]
par(mfrow=c(3,3))
for(i in 1:9) {
d<-density(sag[,i])
plot(d,type="n", main=colnames[i])
polygon(d,col="red",border="grey")}
where sag is
2008 Jul 03
3
apply with a division
Hi,
I'd like to normalize a dataset by dividing each row by the first row.
Very simple, right?
I tried this:
> expt.fluor
X1 X2 X3
1 124 120 134
2 165 163 174
3 52 51 43
4 179 171 166
5 239 238 235
>first.row <- expt.fluor[1,]
> normed <- apply(expt.fluor, 1, function(r) {r / first.row})
>normed
[[1]]
X1 X2 X3
1 1 1 1
[[2]]
X1 X2 X3
1
2011 Jul 15
2
scaling advice
Hi,
I have a consultants nightmare -- I was given a project that another
consultant did and I was told to do the same calculations, but there's
no documentation on what he did. Basically, I have yes/no answers to
survey questions about the effectiveness of product attributes by
brands. There are 44 attributes and 13 brands. The other guy scaled
the proportion of respondents who said
2012 May 08
1
two Y Axes (in the same scale) in ggplot2
Dear R users,
I'm plotting housing prices in City A over past 30 years in ggplot2. The Xs
are years since 1980. I have two housing price variables: new home prices
and old home prices, both of them measured by $/sqft. I have searched
related threads on multiple Y axes in ggplot2 and I understand that
multiple Y axes in different scales are not possible. I'm wondering if it
is possible to
2012 May 08
1
Two Y axes (same scale) in ggplot2 or plot
Dear R users,
I'm plotting housing prices in City A over past 30 years in ggplot2. The Xs
are years since 1980. I have two housing price variables: new home prices
and old home prices, both of them measured by $/sqft. I have searched
related threads on multiple Y axes in ggplot2 and I understand that
multiple Y axes in different scales are not possible. I'm wondering if it
is possible to
2002 Nov 15
1
lattice: formatting tickmark labels of log scaled axes
Problem:
How can I format tickmark labels of log scaled axes of lattice
graphics in the usual `xxx'-Format (and not in the scientific
format).
Example:
(according to the help-page of xyplot):
In the first plot I get the xxx-Format,
in the second plot I get the scientific format (10^xxx):
data(sunspot)
plot( 1:37, sunspot, log='y',type='l')
xyplot( sunspot ~ 1:37,
2001 Oct 05
1
nls() fit to a lorentzian - can I specify partials?
First, thanks to all who helped me with my question about rescaling axes
on the fly. Using unlist() and range() to set the axis ranges in advance
worked well. I've since plotted about 300 datasets with relative ease.
Now I'm trying to fit a lossy oscillator resonance to (the square root of)
a lorentzian (testframe$y is oscillator amplitude, testframe$x is drive
frequency):
lorentz
2008 Jan 15
1
how to fit model to split data and get residual plots
I have a data set with the following structure (with many more obs.):
var1 expt day diameter
1 1 2 0.5
1 1 3 0.9
1 1 4 1.3
1 1 5 1.7
1 2 2 0.3
1 2 3 0.5
1 2 4 0.9
1 2 5 1.6
2 1 2 0.7
2 1 3 1.2
2 1 4 1.6
2 1 5 2.3
2 2 2 0.4
2 2 3 0.8
2 2 4 1.6
2 2 5 3.2
I can get separate regression analysis for each level of var1 and expt
with the command:
by(data3, data3$var1:data3$expt, function(x)
2012 Mar 28
1
xyplot lattice fine control of axes limits and thick marks (with log scale)
After a long and winding road (sorry but I'm a novice) I get to a final
result which is quite close to what I need;
nevertheless I would like to tweak a little further the xyplot so that I can
get ***for each single panel defined by variable z*** a finer control over:
-the x and y the limits: I would like to be the same for both axes;
-the number of thick marks: again I would like to be same
2004 Mar 25
1
How to add a top X-axis with a different logarithmic scale?
Hi,
I am trying to put on one plot two different logarithmic
scales, using the bottom and top X-axes.
Below there is an example of what I am trying to achieve,
using axTicks() -- and fails.
I already spent few hours on that, and cannot figure out from
?par and ?axTicks what I am doing wrong.
Example follows:
############################################################
#### Data
x <-
2006 Jul 28
3
scatter plot with axes drawn on the same scale
Dear useRs,
I'd like to produce some scatter plots where N units on the X axis are
equal to N units on the Y axis (as measured with a ruler, on screen or
paper). This approach
x <- sample(10:200,40) ; y <- sample(20:100,40)
windows(width=max(x),height=max(y))
plot(x,y)
is better than plot(x,y) but doesn't solve the problem because of the
other parameters (margins etc). Is
2010 Nov 04
3
ANOVA table and lmer
The following output results from fitting models using lmer and lm to
data arising from a split-plot experiment (#320 from "Small Data Sets"
by Hand et al. 1994). The data is given at the bottom of this message.
My question is why is the sum of squares for variety (V) different in
the ANOVA table generated from the lmer model fit from that generated by
the lm model fit. The
2008 Jul 30
1
Setting fixed size for segement plot using stars() (axes size vs print size)
I have been making some segment plots with five variables. They work great, especially when I used a different scale function, which scaled them by area of the circle rather than radius
scale <- function(x, Mr = 1 , Mx = 100) { ((x/Mx)^.5)*Mr}
Where x is the the value, Mr is the Maximum radius, and Mx is the maximum data value. You could change the exponent .5 to .57 if you wanted Flannery
2010 Sep 13
2
Overlay of two graphs of different axes
Though I have read quite a bit, and tried quite a bit, I have yet to
find a nice way to overlay 2 or more curves in the same plot, with
different ranges.
Here is simplified sample code to demonstrate the question:
> plot(2*(seq(1,5)), type="l", axes=FALSE)
> curve(2*(seq(1,5)), type="b", add=TRUE)
Error in curve(2 * (seq(1, 5)), type = "b", add = TRUE) :
2010 Feb 28
3
Change the scale on a barplot's y axis
I have grades data. I read them from a csv in letter-grade format. I
then converted them to levels
levels(grades$grade)=c('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-')
And then to numbers
grades$gp=grades$grade
levels(grades$gp)=c(4.3,4.0,3.7, 3.3,3.0,2.7, 2.3,2.0,1.7, 1.3,1.0,0.7)
2003 Dec 10
4
Scatterplot axes
Please, could someone help me figure out what seems to be a very simple
problem (and is still taking me hours...).
I want to draw a simple scatterplot but with 'equal' axes, i.e. I want both
axes to go from -3 to 3. Values for x lie between -2 and 0.5, values for y
between -2.2 and 3. I have tried 'usr' and 'eqscplot' and a few other
options, but it doesn't give me the
2019 Apr 12
2
integrate over an infinite region produces wrong results depending on scaling
Dear all,
This is the first time I am posting to the r-devel list. On
StackOverflow, they suggested that the strange behaviour of integrate()
was more bug-like. I am providing a short version of the question (full
one with plots: https://stackoverflow.com/q/55639401).
Suppose one wants integrate a function that is just a product of two
density functions (like gamma). The support of the