Displaying 20 results from an estimated 1000 matches similar to: "superimposing graphs"
2003 May 03
1
can't plot ylab in graph
Dear People,
I am sure I am missing something obvious as usual, but in the following
graph I can't plot ylab.
Ignoring unimportant details, I am plotting one instance of truehist() and
one instance of curve() on the same graph. Truehist() won't let me pass
the ylab argument. It gives me the error
Error in plot.default(xlim, c(0, ymax), type = "n", xlab = xlab, ylab =
2003 Apr 29
4
thick plot lines
Dear People,
In a qqplot I am doing, I get lines/points that are very thick. I've tried
setting the lwd variable to 0.1, but it doesn't seem to have any effect.
Also, I have set the value of lty to dashed, but I still get dots. The
command looks like
qqplot(cdf.inv(seq(0,1,length=size),theta,pos,len),empmargdistvec(len,theta,pos,size),
xlim=c(-theta,theta), ylim=c(-theta,theta),
2009 Jun 03
1
Would like to add this to example for plotmath. Can you help?
Greetings:
I would like comments on this example and after fixing it up, I need
help from someone who has access to insert this in R's help page for
plotmath.
I uploaded a drawing
http://pj.freefaculty.org/R/Normal-2009.pdf
that is created by the following code
http://pj.freefaculty.org/R/Normal1_2009_plotmathExample.R
This will be a good addition to the plotmath help page/example.
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9.
I've been experimenting with plotmath.
I wish it were easier to combine expressions in plotmath with values
from the R program itself. There are two parameters in the following
example, the mean "mymean" and standard deviation "mystd". I am able
to use bquote to write elements into the graph title like
mu = mymean
and R will
2008 Jun 17
2
Accessing Max/Min Value of Density Function
Dear all,
Currently I have the following output
> mydensity <- density(x)
> print(mydensity)
x y
Min. : -92.14 Min. :0.000e+00
1st Qu.: 356.66 1st Qu.:5.530e-09
Median : 805.45 Median :4.681e-05
Mean : 805.45 Mean :5.564e-04
3rd Qu.:1254.24 3rd Qu.:3.370e-04
Max. :1703.04 Max. :5.541e-03
How can I access the Max value of
2008 Apr 08
2
plotmath "overstrikes" in output on a Linux system
I've been testing plotmath. But I'm getting some funny output one one
computer. The problem is that characters are 'jumbled' and overstrike
when symbols are introduced.
Sample code:
mu <- 440.0
sigma <- 12.5
myx <- seq( mu - 4*sigma, mu+ 4*sigma, length.out=500)
myDensity <- dnorm(myx,mean=mu,sd=sigma)
# Here's one way to retrieve the values of mu and sigma and
2010 Apr 16
2
how to change the position of xlab in truehist?
Hi,
I'm wondering how can I change the position of xlab in truehist. For example, the following code creats a histogram with 4 bins for my discrete data. I want each bin to be labelled as 0, 1, 2, or 3 in the middle, so that it's clear each bin corresponds to each of the discrete case.
I was thinking of first delete xlab and then add marks myself, but it doesn't look like it's
2006 Sep 29
2
X-axis labels in histograms drawn by the "truehist" function
Hi,
I have a simple problem that I would appreciate getting some tips. I am
using the "truehist" function within an "apply" call to plot multiple
histograms. I can't figure out how to get truehist to use the column names
of the matrix as the labels for the x-axis of the histograms.
Here is a simple example:
X <- matrix(runif(4000),ncol=4)
colnames(X)
2004 Nov 26
2
hist and truehist
Hello!
Up to now I have been using hist() to display the distributions.
Howevere, I noteiced strange numbers on y (vertical) axis, if I used
probability = T or freq = F option. I thought it is a bug and launched
the R-bug system and found some posts on that matter. Brian Ripley
responded to one, that one should look at truehist() for that. Ok I can
use truehist() if I want to see the ratios
2009 Apr 28
3
truehist and density plots
Hi,
I wanted to plot the histogram of a vector and then, plot the density function of subsets of the vector on the histogram. So I use truehist in MASS package and lines(density) as follows:
length(b) = 1000
truehist(b)
lines(density(b[1:100]))
however the density plot of the first 100 points exceeds the max of y axis (see attached). how is it possible to make a graphics so that the density plot
2004 Sep 09
1
man page of hist points to truehist, which can't be viewed without loading a library?
rdevel from yesterday, also in 1.9.1 (Debian, -3).
The man page of 'hist' (from the graphics package, obtained by
"?hist") suggests 'truehist' under "see also", but 'truehist' isn't
loaded by default (a sensible "of course"), so that "?truehist" fails.
One can do help.search(), of course, which points what to do, but
leads to my
2007 Mar 20
1
truehist bug?
Hi,
Is this a bug in truehist()?
> library(MASS)
> x <- rep(1, 10)
> truehist(x)
Error in pretty(data, nbins) : invalid 'n' value
Thanks,
Gad
> R.version
platform i486-pc-linux-gnu
arch i486
os linux-gnu
system i486, linux-gnu
status
major 2
minor 4.1
year 2006
month 12
day 18
svn
2007 Mar 20
1
truehist bug?
Hi,
Is this a bug in truehist()?
> library(MASS)
> x <- rep(1, 10)
> truehist(x)
Error in pretty(data, nbins) : invalid 'n' value
Thanks,
Gad
> R.version
platform i486-pc-linux-gnu
arch i486
os linux-gnu
system i486, linux-gnu
status
major 2
minor 4.1
year 2006
month 12
day 18
svn
2005 Apr 19
1
Strange behavior in Lattice when superimposing
Hi,
I am trying to do a simple superimposing of two density plots and am
seeing strange behavior (I haven't seen this reported elsewhere). This
little snipit will make it apparent...
a = rnorm(10)
b = rnorm(100, mean=-2, sd=0.5)
densityplot( ~ a + b)
This is supposed to superimpose the two distributions on the plot, as
if they were in different "groups". But the resulting
2013 Jan 14
1
Wrong bin count number with hist() ?
Hi there,
# Consider the following example:
A = 19
B = 20
A< B
A==B
hist(c(1:15,B,50),breaks=c(0,15,A,50),plot=F)$count
hist(c(1:15,A,50),breaks=c(0,15,B,50),plot=F)$count
# I was expecting the same results with the following values of A and B:
A = 19.6019203953960
B = 19.6019204365543
A< B
A==B
hist(c(1:15,B,50),breaks=c(0,15,A,50),plot=F)$count# wrong
2002 Mar 23
1
Normal behavior or bug?
>selectiris<-sample(1:5, 150, replace=T)
> hist(selectiris, plot=TRUE) #freq=TRUE, breaks=5, etc all do the same thing
>truehist(selectiris)
Is the behavior of "hist" in this sample of code correct. On my system
(Windows 2K, SP2) the first and second bars are pushed together, while the
3rd, 4th, and 5th bars are correctly positioned.
The function "truehist"
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
2007 Nov 18
1
many zeroes in rgamma ... what's going on?
Hello fellow R users,
I wanted to view the density on the standard deviation scale of a gamma(0.001, 0.001) prior for the precision. I did this as seen in the code below and found that for some reason rgamma is giving many values equal to zero, which is strange since a gamma distribution is continuous. What is going on here?
Thanks for any help in advance.
Greg
> x1 <- rgamma(10000,
2007 Sep 24
2
truehist?
Hello,
After a long time, I needed the truehist function, but my system
couldn't found it. I tried to install the package MAAS, but I couldn't
found it! Something happened?
Carlos
--
+-----------------------------------------------------------+
Carlos Henrique Grohmann - Guano
Visiting Researcher at Kingston University London - UK
Geologist M.Sc - Doctorate Student at
2003 Apr 14
2
cannot create postscript files with trellis graphics inside a function
Dear People,
If I define
foo <-function()
{
x <- rnorm(500)
trellis.device(postscript, file="plot.ps")
densityplot(~x)
dev.off()
}
and call foo() then plot.ps is just a blank plot. However, if I extract
the lines inside foo and run them, ie.
x <- rnorm(500)
trellis.device(postscript, file="plot.ps")
densityplot(~x)
dev.off()
then plot.ps is created