Displaying 20 results from an estimated 20000 matches similar to: "is there a way to create legends automatically?"
2000 Nov 09
4
memory management
dear experts,
i m very concerned about memory management. would appreciate if you leave
me some tips on handling large datasets..
special interset:
1. importing large data from a text file
2. subsequent manipulations in R
thanks very much
best regards
pan yuming
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
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
2000 Nov 16
2
assign names to matrix
dear all,
i have a matrix and i dont know how to assign names to this matrix.
given v is 100x5 matrix, and label -> c("A","B","C","D","E")
idealy, names(v) <- label, but it doesnt work for different length
if dimnames(v) <- list(1:nrow(v),label), then names(v) return NULL
any smart ways? thanks in advance.
best regards
pan yuming
2003 Jul 28
1
Plotting (mixed) line types and legends
Hi all
I have a question about plotting line types and
legends. Here's a short piece of code to
demonstrate:
x <- y <- seq(1,10)
plot(x,y, type ="l", lty="33")
lines(x,y+1, lty=1)
legend( 8,2,legend=c("lty=1","lty=\"33\""), lty=c(1,"33") )
On my system (see below), the line types in the legend
are not the same as in the
2006 Mar 10
2
Plot.date and legends
Hi:
I'm trying to plot dates on the x-axis of a code, but the legend is not being
displayed. I receive the following error:
Error in match.arg(x, c("bottomright", "bottom", "bottomleft", "left", :
'arg' should be one of bottomright, bottom, bottomleft, left,
topleft, top, topright, right, center
In addition: Warning message:
longer
2006 Sep 22
1
legends in a plot
Hi there,
I have the following plot. The circles and the line do not cross in
the main plot. But in the legend, the circle and the line cross. I am
wondering if there is a way to make the legend look like the plot
without crossing. I looked around but did not find a way to do that.
Is it doable?
plot(x,x^1.5, pch=1, lty=1, type='b')
legend(1,25, legend="hello",pch=1,
2000 Dec 21
2
Legends on plots
I'm trying to develop a systematic way of placing legends on (among other
things) scatterplots of grouped data. The journals in my field can be very
fussy about the placement of figure legends. Typically they want them to
be in either of two places - the upper left corner of the plotting area,
not obscuring any data points, or outside the plotting area in the lower
right hand corner of
2008 Sep 30
1
Adding legends to a plot
Hello,
I have a time series plot drawn using 3 different colored lines, each line
corresponds to different category group. I'd like to put legends on the
plot. I am using "legend" to do this, however, I can either specify lty or
col in legend. Will I be able to do the following in the legend box: a solid
black line then g1, a solid red line then g2, a solid blue line then g3?
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)
2009 Jun 06
1
correct line types in lattice legends
Hallo R-users,
I do not understand how to specify the correct
line and symbol types in the legends of a lattice xyplot.
This is what I tried, but the line types and symbol in the
graph are not seen in the legend.
Any help is appreciated.
Thanks,
Gerrit.
library(lattice)
s<-rep(1:3,len=10)
x<- 1:10
y<- x+s+rnorm(10)
d<-data.frame(s,x,y)
xyplot(y~x, groups=s,data=d,
2013 Jan 26
2
different legends in lattice panels
Hi listers,
I want to make lattice plots xyplots with the indication of legends
inside each panel with only the points and the lines actually ploted
inside each given panel according to the group(ing) factor.
The code below shows what I have achieved so far and I hope will make
clear what I want to have.
It seems to me that my solution is a very "dirty hack" and there
certainly is
2006 Apr 18
4
how to change legend size in a figure
Dear All,
I am producing a figure with many curves on it. How do I make the legends for all those curves smaller so that it can fit the figure itself? The commands I used for ploting are:
plot(x1,y1,col=1,lty=1)
lines(x2,y2,col=2,lty=2)
...
legend(0.3,0.4,c("name1","name2",...),col=1:20,lty=1:20)
Any tips for making the legend fit the figure will very welcome! Thanks!
Best,
2006 Nov 04
2
Placing of legends
Hello,
placings of legends is sometimes tricky.
For placing outside the plot region I found locator to be useful.
Unfortunately, the click defines the upper left corner.
Is there a way to change this corner (say lower right corner)?
Thanks,
Christian
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
=
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
2000 Jun 22
2
Postscript Legends (or not)
I discovered a little problem when using the Windows NT release of R
1.0.1, and it's still there in R 1.1.0.
The boiled down version is this: I want to draw the following plot and
put it into a Postscript file:
x <- c(1,2,3,4); y1 <- c(1,2,3,4); y2 <- c(2,2,2,2)
Fred <- c(1,2)
postscript(file="d:/Bob/Papers/IFM/try2.ps")
plot(x,y1, type="l")
2002 Sep 17
2
grid.legend - lines
I am testing out the grid-plots, but get into a problem making a legend. I
have a line plot and some points, following the model in
grid.plot.and.legend() i manage to get the points correctly in the legend,
but what do I do with the line? (Of cource, I can just draw a line at the
right location on the plot, but I would prefer to use legend)
Morten
--
Morten Sickel
Norwegian Radiation
2002 Jun 05
6
mixing different modes of lty line type specification in legend() ?
Hi List,
is sth. like the following possible:
legend(x,y,c("A","B","C"), lty=list(1,"42","11")) ?
Or: is there a possibility to define a solid line using the "string" mode for lty?
Thanks
Marcus
--
+-------- ><> -------------------------------------------
| E-Mail: eger.m at gmx.de (NEW)
| marcus.eger at
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
2009 Aug 27
1
Wishlist: specify the border color of boxes in legend() (PR#13913)
I could not find a way to specify the border color of the boxes drawn in
a legend, so that the legend can match exactly the colors of the actual
plot (e.g. in the case of two superimposed histograms which have
different shading and different borders).
Indeed, the legend function seems to hard code the color "black" for the
borders in this call:
rect2(left = xt, top = yt +