Like this? theme(legend.position= 'top'
On Thursday, June 17, 2021, 10:52:04 AM PDT, peri He
wrote:
Dear Friends,
I would like to see my legend outside of a ggplot (at the top).
This code is showing the legend inside of a plot:
theme(legend.position=c(0.15,0.97))
But when I changed
Dear Friends,
I would like to see my legend outside of a ggplot (at the top).
This code is showing the legend inside of a plot:
theme(legend.position=c(0.15,0.97))
But when I changed it to : theme(legend.position=c(-0.15,1.5)) , the legend
disappears.
I would appreciate it if you share your id
Thank you David, it is exactly what I needed.
Regards,Phil
> From: dcarl...@tamu.edu
> To: pmassico...@hotmail.com; r-help@r-project.org
> Subject: RE: [R] legend position
> Date: Mon, 2 Dec 2013 14:29:06 -0600
>
> It is not straightforward unless you want the legend in the
>
mber 2, 2013 1:22 PM
To: r-help@r-project.org
Subject: [R] legend position
Hi all.
I'm ploting a raster and I can't find the proper way to move the
legend. For example,
r = raster(system.file("external/test.grd",
package="raster"))plot(r)
How can I put the legend
Thank you, I'll try to work with lattice.
Regards,Phil
> Date: Mon, 2 Dec 2013 12:06:50 -0800
> From: c...@witthoft.com
> To: r-help@r-project.org
> Subject: Re: [R] legend position
>
> It occurs to me that perhaps you're referring to the 'color bar' on the
It occurs to me that perhaps you're referring to the 'color bar' on the right
of the plot. AFAIK you cannot get at that from the raster::plot method.
However lattice::levelplot does allow you to manipulate or remove that
colorbar.
--
View this message in context:
http://r.789695.n4.nabble.
Thank you for reply.
If I'm not wrong, legend(...) will works for discrete elements. I'm not sure
hot to use it for a colorbar legend sur as the one in the example bellow.
Phil
> Date: Mon, 2 Dec 2013 11:49:19 -0800
> From: c...@witthoft.com
> To: r-help@r-project.org
> S
See ?legend . you can add a legend directly to an existing plot. An
example:
legend('topright',c('hot','cold'),lty=1,col=c('red','green'),bg='white')
Now if you're trying to place the legend outside the plot area (i.e. in some
other part of the window),
you'll need to invoke par(xpd=TRUE) . Se
Hi all.
I'm ploting a raster and I can't find the proper way to move the legend. For
example,
r = raster(system.file("external/test.grd", package="raster"))plot(r)
How can I put the legend at the desired position?
Thank in advance,Phil
[[alternative HT
Dear R-helpers,
I'm trying to combine two box plots having two dependent variables:
var1- Orange.area and
var2- Iridescent.area;
two independent categorical factors (each has two levels - 'High' & 'Low'):
fact1- Quantity
fact2- Quality
the data frame (df) is:
Quantity Quality Orange.are
A quick hack to give you space between the line and point (if you only
used solid lines) is to specify lty='ff' to the legend function.
If you want more control then look at setting trace=TRUE and
plot=FALSE and looking at the printed outcome and the return value
from legend. This does not plot t
On 2012-08-16 0:22, Greg Snow wrote:
You can use the grconvertY function to find the position in the
current user coordinates that corresponds to the top of the device
area (instead of using locator).
Thank you very much. grconvertX() and grconvertY() work very well.
Look at the "merge" argu
You can use the grconvertY function to find the position in the
current user coordinates that corresponds to the top of the device
area (instead of using locator).
Look at the "merge" argument to the legend function.
On Wed, Aug 15, 2012 at 10:04 AM, Jinsong Zhao wrote:
> Hi there,
>
> I draw a
Hi there,
I draw a multiple figure in one plot, like the following:
par(mfcol=c(1,5),mar=c(4,4,0,0)+0.2, oma=c(0,0,3,0))
plot(1:10, type = "b")
plot(1:10, type = "b")
plot(1:10, type = "b")
plot(1:10, type = "b")
plot(1:10, type = "b")
Now, I hope to plot the legend like the following:
legend(
On Aug 11, 2011, at 3:38 AM, Peter Maclean wrote:
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")
You display t
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
___
On 20.03.2011 18:52, Hongwei Dong wrote:
Hi, R users,
I there a way that I can control the position of the legend while using
"barplot" function?
For example:
a<-matrix(c(0,0,0.5,0.8,0.9,0.9),2,3)
colnames(a)<-c("X","Y","Z")
rownames(a)<-c("A","B")
a
barplot(a,width = 0.2,legend =
TRUE,axes=FA
Hi, R users,
I there a way that I can control the position of the legend while using
"barplot" function?
For example:
a<-matrix(c(0,0,0.5,0.8,0.9,0.9),2,3)
colnames(a)<-c("X","Y","Z")
rownames(a)<-c("A","B")
a
barplot(a,width = 0.2,legend =
TRUE,axes=FALSE,col=c("coral3","steelblue3"),beside=TRU
Dear Patrick,
Try this:
plot(y, xlab="Survival Time (Months)", ylab="Survival Probability",
mark.time=TRUE, col = c("red", "blue"),
main="Kaplan-Meier Curve of Survival Times - Stratified by Group", lwd=3)
legend('topright',c("Locally Advanced",
"Metastatic"),lty=1,col.text=c('red','blue'))
See ?
List,
Is there any way to specify the position of the legend from within the
following code? If so, how can I do it. As it stands it in the bottom left
corner and I want to move it to the top right. I'm not sure if I can use the
default "plot" or if I need to go with the lattice package. Sugg
Type "?par" at the command line to bring up the help page, then scroll down and
read the sections on xpd and usr.
From: Edwin Sendjaja [mailto:[EMAIL PROTECTED]
Sent: Fri 4/11/2008 9:56 PM
To: Greg Snow; r-help@r-project.org
Subject: Re: [R] Legen
Hello Gred,
I try to read R-Reference, but I cant understand it.
What does par (xpd=NA)? and par('usr')) mean? Thank you.
Kind regards,
Edwin
Am Freitag, 11. April 2008 19:19:24 schrieben Sie:
> Yes, here is one way:
> > plot(1:10, pch=1:2)
> > par(xpd=NA)
> > tmp.u <- par('usr')
> > l
mailto:[EMAIL PROTECTED] On Behalf Of Edwin Sendjaja
> Sent: Friday, April 11, 2008 1:01 PM
> To: r-help@r-project.org
> Subject: [R] Legend position outside
>
> Hello,
>
> Is it possible to get the legend box outside the graphic?
>
>
> Kind regards,
>
>
Hello,
Is it possible to get the legend box outside the graphic?
Kind regards,
Edwin
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and pr
Hello,
Is it possible to get the legend box outside the graphic?
Kind regards,
Edwin
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and pr
25 matches
Mail list logo