Displaying 20 results from an estimated 2000 matches similar to: "problem with `legend' + `substitute'"
2003 May 20
1
legend() with option adj=1
Hi there,
I want 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)
2003 Jun 05
2
Fwd: Re: legend() with option adj=1
Is there a simpler way then the solution to the one that was posted here? I'm
not very proficient with legend, and I don't understand this solution. All
I have is two or more lines on one plot that I want to put a legend on and I
can't figure out how to do it from the examples. Can you give a very simple
example? It does not have to be fancy!! I have never worked with a
2003 Dec 12
1
legend() graphics output bug (PR#5725)
Full_Name: Daniel Gasser
Version: 1.8.1
OS: Win XP
Submission from: (NULL) (130.60.20.92)
The legend()-Function shows a different behaviour than it did in Version 1.6.1.
It plots a black box left of the legend lines on each legend row. In 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
2004 Dec 02
3
Wishlist: simple legend options (PR#7400)
Full_Name: Elizabeth Purdom
Version: 1.9.1
OS: Windows XP
Submission from: (NULL) (171.64.102.199)
It would be nice if legend had the option of some default locations you could
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
1997 May 11
2
R-alpha: Logarithmic scales
Here are another three problems with logarithmic scales:
1) segments() does not work with logarithmic scales. I suggest to change
lines 962-973 in "plot.c":
for (i = 0; i < n; i++) {
if (FINITE(xt(x0[i%nx0])) && FINITE(yt(y0[i%ny0]))
&& FINITE(xt(x1[i%nx1])) && FINITE(yt(y1[i%ny1]))) {
GP->col = INTEGER(col)[i % ncol];
1999 Sep 11
1
legend(): adjust space between symbol and tex
Hello,
I'd like to ask, how to adjust the space between symbol/line and text in a
legend. My legend() is build like that
legend(xmax-netzdiff/11, # shouldn't matter here
ifelse(ydiff>=0, #
ymin-6.5*(netzdiff/11), #
ymax-netzdiff/11), #
c("stehender Stamm","Windwurf",
2004 Aug 20
0
legend lwd - feature request (PR#7023)
Lfo@psykiatri.aaa.dk wrote:
> (R1.9.1 Windows)
>
> In legend( ) lwd have no effect on points - contrary to the behaviour
> in e.g. plot( ) and points( ). It would be nice to have an option pt.lwd
> affecting the line width of legend points (like pt.cex changes the
> magnification).
>
>
> An example (note the difference in line width between points in the
> plot
2005 Feb 14
2
Wishlist: simple legend options (PR#7400)
Hello!
I was loooking in R-bugs and found under wishlist-fullfilled wish for
"smart" placement of a legend. This has already been done in package
gplots in function smartlegend.
One question. This "bug-report" is under wishlist-fullfilled. Is it really
fullfilled?
Mail from Elizabeth
---------------------------------------------------------------
It would be nice if
2012 Oct 10
2
r-plot help-it prints outside frame
Hello,
i have been doing browns exponential smooting 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 =
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,
2002 Jul 31
2
Bug in legend?
This is a bit obscure but caused me some grief... R1.5.1/MS
Windows
There seems to be a peculiarity in legend associated with the use
of expression text. It seems as if expression text is used in (eg) an
mtext call then if the call to legend also includes expression text
and a subscript then the legend box and line spacing depends on
the value of cex used in the previous call to mtext,
2010 Feb 07
4
x-axis plot problem
Hi all,
I tried to have plot of many vector in one plot and i have got a nice plot
but i have problem with x-axis. I want to have month and year only(Jul.07
means July 2007) in x-axis without appearing other number behaind it.
I would appercit any help.
The R code:
F<-c(7.49,6.91,6.78,6.99,7.44,7.42)
M<-c(4.81,4.51,5.21,4.65,4.75,3.86)
P<-c(7.49,15.03,15.19,15.32,15.42,15.45)
2008 Nov 07
0
barplot can put legend in wrong place, request option to override that (PR#13265)
This in an enhancement requestion, to add the capability to pass
arguments through barplot() to legend(). I've created a version that
does this.
# Run this code; notice that the legend
# is superposed over one bar:
barplot(height =
cbind(x = c(465,91) / 465 * 100,
y = c(840,200) / 840 * 100,
z = c(37,17) / 37 * 100),
beside = FALSE,
width =
2000 May 31
1
legend with multiple columns
I have made a minor hack to "legend" (in R 1.0.0, but I didn't notice
any changes to legend in the 1.0.1 NEWS) to allow the legend to be
formatted in multiple columns, or horizontally (number of columns <-
number of legend items). (I find this helpful when I have lots of legend
items and not a lot of vertical space to squeeze the legend into.)
(Another hack I've considered
2007 Aug 31
1
Question on shardsplot
Dear All,
Would you please tell me how to display the sample 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 =
2000 Sep 18
1
phantom(0) doesn't do what I expect it to [plotmath]
Hi,
I'm trying to make a legend with a justified list of numbers, so I
thought I would use phantom(0) to align the 3-digit numbers properly
with the 4-digit ones:
legend(x, y, xjust=1, yjust=1, lty=c(1,2,3,4,5), adj=c(0,0.5),
legend=expression(phantom(0)*300*plain(K),
phantom(0)*550*plain(K),
phantom(0)*830*plain(K),
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>
2009 Jun 26
3
Automatically placing a legend in an area with the most white space...
At one point I believe I heard of an R package that would automatically find the most empty space in a plot, and then that answer could then be used to intelligently place a legend.
I would like to try to apply that R package to the contrived example shown below, so thank you for any hints or tips that can be provided.
x = seq(0, 1000, by = 1)
y1_vals<-rnorm(1000, mean = 0, sd = 50)