Displaying 20 results from an estimated 20000 matches similar to: "legend for several graphics"
2009 Nov 30
1
Plotting color.legend() outside of plot region
Dear List,
I am trying to plot a color.legend() in the right outer margin of my device region. I have read multiple threads on the subject and still can't get it right. I have stolen an example from one of the threads to demonstrate my problem. I have extended the outer margin using par(oma()), and have used par(xpd=NA) to tell it to plot in the device region. I can get the legend to plot
2005 Nov 28
7
combine two columns
Hi,
I have an R programming problem and I havent found anything in the
documentation yet:
I have a data matrix, in which two neighbouring columns represent
replicates of the same experiment, e.g. something like this:
A A B B C C
row1 1 1 1 2 2 2
row2 1 1 1 1 1 2
I would like to test, if the values for the two replicates in a row
are the same or if they differ and generate a new
2006 Apr 10
2
Legend in the outer margin
Dear Rs
I have a 3x3 multiple plot. I would like to have a overall legend in
the outer right margin.
From the help archive, I found that it can be done by setting
par(xpd=NA). However, I couldn't find the correct values
for x and y co-ordinates for the legend. Please find the code snippet below:
par(mfrow=c(3,3), mar=c(4,4,0.9,0.5), oma=c(1,2,2,4),cex.main=1.1)
2005 May 12
2
mget empty strings
Dear R community,
I am a beginner to R and have a question concerning mget, about I could
not find anything in the various documentation.
I have a column in a dataframe x for which I want to get values in y:
mget(x[,1], env=y, ifnotfound=NA)
I receive an error mesage:
Error in mget(x[, 1], env = y, ifnotfound = NA) :
attempt to use zero-length variable name
this is probably due to
2009 Oct 07
3
graphics
Dear Sir,
I am using the following cos which creates a 3 panel figure on one image. However the legend function i am using only allows the legend to be placed within the axes of one of the graphs.
The plots however do not allow for a logend to be places within the axes do to the location of points on the graph. I can add the legend later using imaging software such as paint but i lose
2008 Feb 18
1
Plotting a legend outside the figure - units
Dear R gurus,
I am trying to plot a legend in the margins of a figure. The basic idea is to have two (or more) plots on the same figure, but then to have a common legend at the bottom of the plot. The approach that I have taken is to setup the figures, then do a "dummy" plot of the legend to determine the height of the legend box (ie from the value returned by the legend() command). I
2007 Oct 24
2
Graphics - plotting two graphs
Hi,
I wanted to plot 2 lines on a single graph. Each graph has one axis that can be common. The code that I'm using is:
-------------------------------------------------------
par(mfrow=c(1, 1))
x1 <- c(2, 4, 6, 8, 10, 12)
x2 <- c(10, 20, 30, 40, 50, 60)
y1 <- c(10,12,15,22,34,21)
y2 <- c(40, 130, 150, 145, 40, 30)
par(las=1, mar=c(4, 4, 2, 4))
plot.new()
2010 Nov 05
2
Legend para varios gr�ficos
Hola a todos,
Mi pregunta es si hay alguna manera (sencilla/rápida o no) de colocar
una leyenda común para dos gráficos colocados en paralelo con
par(mfrow=c(1,2)).
He probado con par(xpd=NA) y con par("usr") pero no encuentro la solución.
Está claro que podría poner la misma leyenda para cada gráfica, pero
quedaría mejor con una global para ambos.
Muchas gracias de antemano por la
2008 Sep 04
2
Adding a legend to R graph device with several plots (no to individual plots!)
Dear Users, I already posted this question: it either went unnoticed,
or it is to basic (if this is so, please sent me a hint).
I would like to know if there is a way to add a common
legend to an arrangement of plots. In the example below, I get four
plots in my device. each one has a density for 1995 and one for 2006.
I have found that using legend or smartlegend I can add a legend to
each plot,
2008 Apr 10
1
legend placement
Hi,
I am plotting 5 charts using p <- par(mfrow = c(3, 2), how can I place my
legend in the last region ? I don't wan to put it into the margin.
[[alternative HTML version deleted]]
2006 Jul 12
1
legend outside plotting area
Hi,
I would like to place a legend outside a plotting area. Could anybody
give me a hint how this is done?
Cheers,
Georg
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 Dec 07
1
multiple plots using summary in rms package
Dear All,
I wonder if someone can point me in the right direction here. I'm working
with the rms library, R 2.9.2 under Windows XP.
I'm trying to arrange two plots side by side for a colleague. mfrow or
mfcol do not seem to work, however, so I am obviously missing something
important. I know that there have been changes in the graphics from Design
to rms, but am just not sure where to
2008 Nov 27
1
A small bug in R code of the legend function of the Graphics pacakge (PR#13340)
Full_Name: Arkady Sherman
Version: 2.8.0
OS: Windows XP
Submission from: (NULL) (158.195.16.114)
Please consider initialization of the "seg.len" variable. It's done only
if (do.lines) { seg.len <- 2 ..,
but after the seg.len is used:
if (has.pch) {
pch <- rep(pch, length.out = n.leg)
pt.bg <- rep(pt.bg, length.out = n.leg)
pt.cex <-
2010 Apr 26
5
How to make legend with line+ character
Dear all,
I have a multiline plot with each line labeled with a different letter.
But I'm not able to make the legend display the same kind of pattern
'-a-', instead the letter is overwritten by the line. A simpler legend
with only the letter is not very visible and the pt.bg does nothing with
letters. Any idea?
plot(1:10,10:1,lty=1,type='b', lwd=2,pch='a')
2007 Nov 24
1
Hmisc: can not reproduce figure 4 of Statistical Tables and Plots using S and LATEX
Dear R-users:
I can not reproduce figure 4 of *Statistical Tables and Plots using S and
LATEX* by Prof. Frank Harrell with the following code:
rm(list=ls())
library(Hmisc)
getHdata(pbc)
attach(pbc)
age.groups <- cut2(age, c(45,60))
g <- function(y) apply(y, 2, quantile, c(.25,.5,.75))
y <- with(pbc, cbind(Chol=chol,Bili=bili))
# You can give new column names that are not legal S names
2014 Jun 24
2
Making several plots using a loop function
Hi all,
When making a bunch of plots using a loop function, how to add title to
reflect different plots.
Specifically, for the code below, I generated 9 plots. I would like to add
a title to each plot.
For example, the titles will be respectively, plot1, plot 2, … plot 9.
Thank you very much!
Hanna
par(mfrow=c(3,3), pty="s", pch=16, col="blue")
for ( i in 1:9) {
lm1
2005 Aug 16
1
Overall Legend
Hello. I am using R version 2.1.1 on Windows 2000.
I am using a par(mfrow=c(2,2)) statement to produce 4 plots on one screen. I want a single horizontal legend to appear at the top of the four plots. My code is something like this:
par(mfrow=c(2,2))
plot(x,y1)
lines(x,y2)
lines(x,y3)
plot(x,z1)
lines(x,z2)
lines(x,z3)
plot(x,t1)
lines(x,t2)
lines(x,t3)
plot(x,w1)
lines(x,w2)
lines(x,w3)
2004 Dec 09
4
Create a plot legend in a new window
Hi
I have a complicated plot which has a potentially large legend. What I
want to do is actually create the legend in a new window. Has anyone
done this before? I'd like to be able to create a window with just the
legend in it, and have it so the window is just the right size etc. I'm
sure someone must have done this already? If not, any tips would be
welcome.
Thanks
Mick
2003 Jan 17
2
Re: Universal legend in plot
Dear R-users:
I asked a question on how I can have a universal legend in a plot and
received the following result. I tried using "layout" but I can't seem to
work on the "empty" plot (where I have to have the legend). I tried "oma"
but I couldn't improve the quality of the plot, and that I didn't know how
to specify all the line types using the