Displaying 20 results from an estimated 64 matches for "xjust".
Did you mean:
just
2005 Oct 21
3
make three plot to one plot
...lly,
Jan Sabee
test.five.x <- c(0.02,0.05,0.07,0.09,0.10,0.12,0.13,0.14,0.16,0.17,0.20,0.21,0.34,0.40)
test.five.y <- c(18,12,17,12,3,15,1,5,1,1,3,10,15,10)
plot(test.five.x, test.five.y, type="l",lty=1, lwd=3, col='red')
legend(par('usr')[2], par('usr')[4], xjust=1,
c('five'),
lwd=3,
lty=1,
col=c('red'))
test.six.x <- c(0.03,0.05,0.07,0.08,0.09,0.10,0.12,0.13,0.14,0.15,0.17,0.18,0.21,0.22,0.24,0.33,0.39,0.43)
test.six.y <- c(8,32,14,21,3,8,11,14,11,21,16,14,10,21,1,2,13,19)
plot(test.six.x, test.six.y, type=&quo...
2007 Feb 28
4
legend question
...ntation I cannot find where the
problem is.
I want to add a legend to a figure. If I use a simple example drawn
from the R Reference Manual such as, for instance:
x <- seq(-pi, pi, len = 65)
plot(x, sin(x), type="l", col = 2)
legend(x = -3, y = .9, "legend text", pch = 1, xjust = 0.5)
then everything works just fine.
However, if I use other data such as, for instance:
y<-c(1960, 1965, 1970, 1975)
z<-c(1, 2, 3, 4)
plot(y, z, type="l", col = 2)
legend(x = -3, y = .9, "legend text", pch = 1, xjust = 0.5)
then the legend is not shown.
Any hints?...
2004 Aug 20
0
legend lwd - feature request (PR#7023)
...,8,4)
> plot(x,y,bty="l",lwd=3,type="o",col=2,ylim=c(min(y,y2),max(y,y2)),cex=1.5)
> points(x,y2,lwd=3,lty=8,col=4,type="o",pch=2,cex=1.5)
> legend(10,max(y,y2),legend=c("Method 1","Method
> 2"),col=c(2,4),lty=c(1,8),pch=c(1,2),
> xjust=1,yjust=1,pt.cex=1.5,lwd=3)
>
> Workaround (thanks to Peter Dalgaard):
> x <- 1:10 ; y <- rnorm(10,10,5) ; y2 <- rnorm(10,8,4)
> plot(x,y,bty="l",lwd=3,type="o",col=2,ylim=c(min(y,y2),max(y,y2)),cex=1.5)
> points(x,y2,lwd=3,lty=8,col=4,type="o"...
2003 Jun 05
2
Fwd: Re: legend() with option adj=1
.... Consider this short
> reproducable example.
>
> x <- 1:5
> y1 <- 1/x
> y2 <- 2/x
> plot(rep(x,2),c(y1,y2),type="n",xlab="x",ylab="y")
> lines(x,y1)
> lines(x,y2,lty=2)
> legend(5,2,c("1,000","1,000,000"),lty=1:2,xjust=1,yjust=1)
> legend(5,1.5,c("1,000","1,000,000"),lty=1:2,xjust=1,yjust=1,adj=1)
>
> Now, I would like to right-justify the text of the legend. As you can see,
> the option adj=1 does not give satisfactory results.
>
> Is this a bug or is there an easy way that...
2003 May 20
1
legend() with option adj=1
...t to justify to right the text of my legend. Consider this short
reproducable example.
x <- 1:5
y1 <- 1/x
y2 <- 2/x
plot(rep(x,2),c(y1,y2),type="n",xlab="x",ylab="y")
lines(x,y1)
lines(x,y2,lty=2)
legend(5,2,c("1,000","1,000,000"),lty=1:2,xjust=1,yjust=1)
legend(5,1.5,c("1,000","1,000,000"),lty=1:2,xjust=1,yjust=1,adj=1)
Now, I would like to right-justify the text of the legend. As you can see,
the option adj=1 does not give satisfactory results.
Is this a bug or is there an easy way that I'm missing?
Thanks,
J...
2003 Dec 12
1
legend() graphics output bug (PR#5725)
...1.6.1 there
was just the line in appropriate color for each row in the legend (i was using
exactly the same legend statement and same plot function).
My legend statement is:
legend(x=(daysold+2), y=0.95*maxy.j, legend=leg.txt, col = leg.col, lty=1,angle
= NULL, density = NULL, bty = "o", xjust = 0, yjust = 1, x.intersp = 1,
y.intersp = 1, ncol = 1, horiz = FALSE)
If i write the statement as follows:
legend(x=(daysold+2), y=0.95*maxy.j, legend=leg.txt, col = leg.col, lty=1,angle
= NULL, density = NULL, bty = "o", xjust = 0, yjust = 1, x.intersp = 1,
y.intersp = 1, ncol = 1, hor...
2002 Jul 31
2
Bug in legend?
...lot(c(0,1),c(0,1),type="n",xaxt="n",yaxt="n",xlab="",ylab="")
#empty plot
mtext(expression(Expression~text),cex=i/2) #Some text in
margin - expression TEXT
legend(.5,.5,expression(Some[subscripted],Thing),lty=c(1,2),bty="o
",xjust=.5,yjust=.5,cex=1) #Draw legend with subscript in middle of
plot
}
#This does what it should
for (i in 1:4)
{
plot(c(0,1),c(0,1),type="n",xaxt="n",yaxt="n",xlab="",ylab="")
#empty plot
mtext("Normal Text",cex=i/2)...
1997 May 11
2
R-alpha: Logarithmic scales
...UNPROTECT(3);
return R_NilValue;
}
3) The legend() function needs changes as well. I attach my
quick hack below, but I think there are better solutions... :-)
legend <-
function (x, y, legend, fill, col = "black", lty, pch, bty = "o",
bg = par("bg"), xjust = 0, yjust = 1, ...)
{
xlog <- par("xlog")
ylog <- par("ylog")
if (xlog)
x <- log10(x)
if (ylog)
y <- log10(y)
xchar <- xinch(par("cin")[1])
ychar <- yinch(par("ci...
2008 Nov 07
0
barplot can put legend in wrong place, request option to override that (PR#13265)
...cbind(x = c(465,91) / 465 * 100,
y = c(840,200) / 840 * 100,
z = c(37,17) / 37 * 100),
beside = FALSE,
width = c(465, 840, 37),
col = c(1, 2),
legend.text = c("A", "B"),
args.legend = list(x = 35, y=140, xjust=0, yjust=.5, lty=2))
$ diff -c barplot.R barplot2.R
*** barplot.R Mon Aug 11 02:51:52 2008
--- barplot2.R Fri Nov 7 11:52:00 2008
***************
*** 25,31 ****
xlim = NULL, ylim = NULL, xpd = TRUE, log = "",
axes = TRUE, axisnames = TRUE,
cex.axis = par(&quo...
2000 May 31
1
legend with multiple columns
...PATCHES to legend.Rd and legend.R:
*** legend2.txt Wed May 31 14:45:18 2000
--- legend2.R Wed May 31 15:02:22 2000
***************
*** 1,7 ****
! function (x, y, legend, fill, col = "black", lty, lwd, pch, bty = "o",
! bg = par("bg"), cex = 1,
! xjust = 0, yjust = 1, x.intersp = 1, y.intersp = 1, adj = 0,
! text.width = NULL, merge = do.lines && has.pch, trace = FALSE)
{
if(is.list(x)) {
if(!missing(y)) { # the 2nd arg maybe really is `legend'
--- 1,9 ----
! function (x, y, legend, fill,...
2002 Nov 12
1
problem with `legend' + `substitute'
....0
,substitute ( paste ( Sr["2"] ,GaMnO["5.541"]
,", T = " ,T ,"K"
)
,list (T = T)
)
,bg = "white"
,xjust = 0.5
,yjust = 0.5
)
So, I get plot with not one, but *six* instances of the desired expression,
one under another!
Ok, trying to use `text' ..
plot(x)
text ( 1.0 ,1.0
,substitute ( paste ( Sr["2"] ,GaMnO["5.541"]...
2004 Dec 02
3
Wishlist: simple legend options (PR#7400)
...choose instead of entering specific coordinates, like "topleft",
"topright","topcenter", etc. based on par("usr") coordinates. I know I've wanted
it so often I've made my own simple non-robust wrap-around, so I don't have to
remember or parse the xjust and yjust options necessary to make it work. Of
course there should be the option of entering in your own coordinates.
Also it would be nice to be able to put a optional title inside your legend.
Currently I just make my title the first value in my legend vector, and then fix
the other options so...
2012 Oct 10
2
r-plot help-it prints outside frame
...oting for myself and have a little
trouble with plotting values:
par(xpd=TRUE)
plot(vector,xlab="Period",ylab="Values")
legend(max(vector), legend = c("Original values", "Estimated values"),
col=c("blue","red"),lwd=0.5, cex=1, xjust=0.1, yjust=-0.3)
lines (vector, type = "o", col="blue") #original values
lines (est_vector, type = "o", col="red") # estimated values
lines (length(vector)+1,forecast, type = "o", col="green") #forecasted
value
i get result a...
2010 Feb 07
4
x-axis plot problem
...",main="Model Output")
legend("topleft", legend = c("F", "M","P","B"),text.width =
strwidth("1,000,000,"),pch=c(1,22,17,16),col =c("gray10","
gray10","gray10","gray10"),lty=c(2,2,2,5), xjust = 1, yjust = 1, bty="n",
cex=0.8, ncol=2)
axis(1, 1:6, row.names(model))
--
View this message in context: http://n4.nabble.com/x-axis-plot-problem-tp1472286p1472286.html
Sent from the R help mailing list archive at Nabble.com.
2008 Apr 10
6
How to create a legend without plot, and to use scientific notation for axes label ?
Hi,
I have a 3 by 2 plots per page, and would like to place a legend on the last
region. How to do that ?
Also, is there any way to specify scientific notation for axes label ?
[[alternative HTML version deleted]]
2000 Jun 09
2
w0 in legend
In Version 1.1.0 Under development (unstable) (June 8, 2000)
there seems to be a problem with an internal variable w0 in legend that
generates the following new error:
Error in legend((par()$usr)[1:2], (par()$usr)[3:4], Legend, lty = lty, :
Object "w0" not found
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read
2010 Jan 12
1
Multiple symbols per single line in a legend
Hello everybody,
Is it possible to coax legend() into displaying more than one simbol per
line in legend? I have a graph like the one attached to this mail; I would
like to reorganize the legend in such a way that the duplicate text would be
omitted, i.e., the first line would read <square> <triangledown> "increasing
frequency" and the second one would read <circle>
2007 Aug 31
1
Question on shardsplot
...No. on the map ?
---Below commands don't display the sample No.(from 1 to 150).---
library(som)
library(klaR)
iris.som3 <- som(iris[,1:4], xdim = 14,ydim = 6)
library(klaR); opar<- par(xpd = NA)
shardsplot(iris.som3, data.or = iris,label = TRUE)
legend(3.5,14.3, col = rainbow(3), xjust =0.5, yjust = 0,legend =
levels(iris[, 5]),pch = 16, horiz = TRUE)
par(opar)
----------------
Ebi
[[alternative HTML version deleted]]
2008 Oct 06
1
Color of title in legend()
...ear R-helpers,
This produces a red title. How do I make it black, without making the
labels black?
legend(title = 'Channel Integration', 0.7, 0.3,
c('loudness','luminance'), col = c('red', 'blue'), text.col = c('red',
'blue'), lty = 1, xjust = 0.5, bty = 'n')
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
Parcels: Room 102 Gilmer Hall
McCormick Road Charlottesville, VA 22903
Office: B011...
1997 Aug 04
0
R-alpha: `axes' argument for barplot()
...rg, col=NULL, border=par("fg"),
beside=FALSE, space=0.2, legend.text,
! main=NULL, xlab=NULL, ylab=NULL, xlim, ylim, axes = TRUE, ...)
{
opar <- par(yaxs="i", xpd=TRUE)
on.exit(par(opar))
*************** function (height, names.arg, col=NULL, b
*** 68,72 ****
xjust=1, yjust=1)
}
title(main=main, xlab=xlab, ylab=ylab, ...)
! axis(2)
}
--- 68,73 ----
xjust=1, yjust=1)
}
title(main=main, xlab=xlab, ylab=ylab, ...)
! if (axes)
! axis(2)
}
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -...