Displaying 20 results from an estimated 20000 matches similar to: "position of a legend-object"
2011 Aug 11
1
legend position in interaction.plot
How do I move the legend from default position (right and within the plot)?to the "bottomleft" of the plot?
?
interaction.plot(YEAR, ID?GROWTH, legend=TRUE, col = 2:7,xlab="Year",
?????? ylim=c(0,2), ylab="Growth",leg.bty = "o")
Peter Maclean
Department of Economics
UDSM
2007 May 22
4
Legend outside plotting area
Hi,
I have been trying many of the suggested options
to place a legend outside plotting area, including
something like this:
par(xpd=T,
oma=par()$oma+c(4.5,0,1.5,0),mar=par()$mar+c(1,0,1,0)
But the aspect of the four plots gets compromised
when I change the margin settings. I cannot use mtext
because I need to use colors for the text. I tried
layout, but wouldn't let me include
2008 Jun 16
1
ggplot2: How to remove legend component for geom_errorbar() ?
Dear list (probably Hadley),
I'm trying to do a plot like the following, composed of bars and error
bars:
df <- data.frame(factor1=gl(2,5), factor2=gl(5,1), y=rnorm(10),
err=0.1)
ggplot(df, aes(x=factor1, y=y, fill=factor2)) +
geom_bar(position="dodge", stat="identity") +
geom_errorbar(aes(min=y-err, max=y+err), position="dodge",
width=0.1)
The
2012 Feb 16
2
Legend vanishes when placed outside the graph
Hello everyone,
i’ve got a problem with my diagram’s legend. I know i should be able to figure it out by reading the ‘plot’ and ‘legend’ reference. However nothing works so it would be kind if anyone could point me to the necessary parameters.
The problem is that i’m moving the legend using the ‘inset’-parameter so it does not overlap with the graph. However it vanishes outside the graph, so
2005 Feb 02
2
Frequency of Data
Hello,
just another problem in R, maybe it's simple to solve for you. I didn't find
a solution up to now, but I'm convinced that I'm not the only one who
has/had a similar problem. Maybe there's a ready-made function in R?
The prob:
I've imported a CSV-file into R with 1000 dates of an observed event
(there's only information of the date. When there happend no
2005 Feb 25
2
Simulation Progress
Hi,
I've made a function that executes a monte-carlo simulation.
It always needs a lot of time until e.g. 1Mio simulation steps are done.
So I would like to know, how many percent of the work is already done.
In an Excel/VBA Solution I could easily implement a status bar or status
window.
How could an R-Solution look like?
Carsten
2005 Jun 29
2
MLE with optim
Hello,
I tried to fit a lognormal distribution by using optim. But sadly the output
seems to be incorrect.
Who can tell me where the "bug" is?
test = rlnorm(100,5,3)
logL = function(parm, x,...) -sum(log(dlnorm(x,parm,...)))
start = list(meanlog=5, sdlog=3)
optim(start,logL,x=test)$par
Carsten.
[[alternative HTML version deleted]]
2005 Jul 12
1
three par. fitting with fitdistr
Hello,
I want to fit a tree parameter distribution to given data. I tried it with
sample data using the "fitdistr" function.
Here my workflow that didn't had any result:
I started with the generalized gamma distr, which is:
r*dgamma(x^r,shape,rate)
The R-function is:
ggamma = function (x,r,shape,rate) r*dgamma(x^r,shape,rate=rate)
For the first step I assumed r = 1 and I
2003 Feb 24
5
exact range of axes in plots
Hello. I was wondering how one can find the exact values of the range of
an axis within a plot. In xlispstat it was (send plot :range 0). Thanks much,
Jason
2007 Sep 10
3
plot legend: combining filled boxes and lines
Hello,
I have difficulties combining boxes and lines in plot legend. I
searched previous R-posts and found this (with no solution):
http://tolstoy.newcastle.edu.au/R/help/06/07/30248.html. Is there a
way to avoid boxes behind the line legends?
x1 <- rnorm(100)
x2 <- rnorm(100, 2)
hist(x1, main = "", col = "orange",ylab = "density", xlab = "x", freq
=
2003 Apr 15
2
troubles with displaying legend on the plot
Dear colleagues,
I have troubles while trying to display legend on the plot.
I have data.frame fr
> fr
year M1 M2
1 1979 58.85198 56.77303
2 1980 57.59725 55.93749
3 1981 57.32133 55.55232
4 1982 54.69320 53.10566
5 1983 56.58973 55.03811
6 1984 58.81363 56.97641
7 1985 58.35583 56.82091
8 1986 60.41842 58.45457
9 1987
2006 May 10
2
Legend titles in log plots broken? (ver. 2.2.1)
Legend titles work in linear plots:
curve(1/x, xlim = c(0, 1))
legend(x = 'topright', inset = 0.04,
legend = '1/x', lty = 1,
title = 'Legend Title')
But when you change to a log plot on either dimension things get screwy:
curve(1/x, xlim = c(0, 1), log = 'y')
legend(x = 'topright', inset = 0.04,
legend = '1/x', lty = 1,
2010 Feb 03
1
legend help
i=1
for(rate in c(2,4) ){
for(shape in c(1,3,5) ){
curve(dgamma(x,rate,shape),xlim=c(0,3),ylab="",col=i,lty=i,add=T)
i=i+1
}
}
How can I add some legend to represent these lines?
i.e. the legend is displayed as
col=1 lty=1 lambda=2 theta=1
col=2 lty=2 lambda=2 theta=3
col=3 lty=3 lambda=2 theta=5
col=4 lty=4 lambda=4 theta=1
col=5 lty=5 lambda=4 theta=3
col=6 lty=6 lambda=4 theta=5
2005 Jul 19
2
Problems with date-format (R 2.1.1 + chron)
Hello,
today I've updated on the newest R-Version. But sadly a function I needed
didnt want to work:
The input is e.g.
days(as.Date("21-07-2005","%d-%m-%y"))
the error is: Fehler in Math.Date(dts): floor nicht definiert f??r Date
Objekte
(Error in Math.Date(dts): floor not defined for date objects)
Same for year. Only months gives me the correct output.
In Version
2005 Mar 23
2
Browser to replace the internal browser?
Hello,
I see that the more I work with R and the more the code gets larger I would
like to have some graphic support in my quellcode.
Is there a browser that could be easily implemened in R?
And how do I call it from R? It would be nice if the browser replaces the
"fix()" function.
Carsten
2004 Jan 15
2
Legend text -- discrepancy between X11 and postscript
Hi,
When I place a legend on a plot it looks exactly as I intended
on the screen. However, almost always, when I export this to
postscript file, the legend's text protrudes through the legend's
frame (the latter being placed correctly).
See the appended example code. I can send the EPS file as well
for those that are interested (<4 kb; <200 lines).
I found nothing in the FAQS,
2005 Apr 05
1
Fitdistr and likelihood
Hi all,
I'm using the function "fitdistr" (library MASS) to fit a distribution to
given data.
What I have to do further, is getting the log-Likelihood-Value from this
estimation.
Is there any simple possibility to realize it?
Regards, Carsten
2005 Jan 31
2
ML-Fit for truncated distributions
Hello,
maybe that my Question is a "beginner"-Question, but up to now, my research
didn't bring any useful result.
I'm trying to fit a distribution (e.g. lognormal) to a given set of data
(ML-Estimation). I KNOW about my data that there is a truncation for all
data below a well known threshold. Is there an R-solution for an
ML-estimation for this kind of data-problem? As
2009 Oct 18
2
How to plot multiple data sets with different colors (also with legend)?
The following commands only show the data in 'y'. I'm wondering how to
show the data in 'x' as well. I also want to add a legend to show that
blue points corresponds to 'x' and yellow points correspond to 'y'.
Could somebody let me know what the correct commands should be?
x=rbind(c(10,11),c(10,11))
y=cbind(-1:0,-1:0)
plot(y,col='yellow')
2008 Dec 11
1
problem with legend
? stato filtrato un testo allegato il cui set di caratteri non era
indicato...
Nome: non disponibile
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081211/4011e3d0/attachment.pl>