Displaying 20 results from an estimated 8000 matches similar to: "Re: [R] expressions in legends (PR#1302)"
2002 Feb 03
0
expressions in legends
Dear R-users,
A few days ago I met the problem of using text produced with
expression() in legend() being elevated relative to text produced
without the expression() so that the alignment with pch and lty is
also messed up. After ferreting through the help I finally came across
an answer, the adj argument of legend(). You can see and example of
this in the Math expressions example section of
2013 Jan 23
1
italic font for legend text when using expression function for symbols
Hello,
I'm trying to add a symbol (Delta) to plot legend with text using
"expression(paste())" but this disables the text.font that allows to use
bold or italic text.
as follows:
x=c(1:10)
y=c(1:10)
plot(x,y)
legend(1,10,legend=c("A","B","C",expression(paste(Delta, D))),
pch=c(24,18,17,16),cex=2,text.font=3,bty="n")
Any suggestion to
2012 May 18
3
colocar subscripts y cursiva
Hola
He estado tratando varias formas de colocar el subíndice para los grados de libertad del F test y la expresión adj; y sencillamente no funciona.
legend("topright",legend=c(expression('r[adj]=0.40'),expression('F[3,23]=15.43'),expression('P < 0.001')),col=black, bty='n',cex=0.9)
Luego al tratar de colocar las cusriva utilizando par(font=3)
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
2012 Jun 08
2
changing font to italic for one entry in legend()
Hello,
I need to change the font for one of the items (C. elegans) in my
legend to italic. Can someone suggest how to accomplish this?
legend('bottomright', bty='n', c('C. elegans range', 'Study area'),
cex=0.8, fill=c('light gray', 'white'), border=c('black','black'))
I tried using lab.font=c(1,3) but R ignored and did not write
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
2008 Aug 07
1
Mtext doesn't display characters in italic when I use a greek symbol
Following on from my previous mail!
plot(1:10,1:10)
mtext("title", side=3, adj=0, font=3, cex=1.5)
This works as expected and puts the font in italics.
tag <- "A)"
suffix <- "genea::"
plot(1:10,1:10)
mtext(bquote(.(tag) ~ Delta * .(suffix)), side=3, adj=0, font=3,
cex=1.5)
Here, the font isn't in italics, it's normal.
I presume this is some
2011 Dec 01
2
legend, "lheight", and alignment
Hello,
A bit of fairly simple code, yet I don't seem to be able to manipulate it
quite as much as I would like:
1) It would be nice if the objects appearing in the legend were aligned,
and by aligned I mean the boxes are centered over the lines. Do I need to
adjust the use of "NA" in the code below to accomplish this? Here's how it
appears on my machine:
2012 Jan 18
2
How do I exactly align the right hand side of "mtext" relative to a plot device? Beyond "adj".
Hi,
I have a problem with aligning text which I'm adding to a plot using
"mtext". I would like to specify the position of the right hand end of the
text string, relative to the device (in the left-right direction).
I've been looking at the use of the argument "adj". But this can't be used
to specify the rightmost point of the text. Neither does it specify exactly
2012 Apr 03
1
Mixed italic and non-italic in text
Hi,
I need to italicize the journal in a citation but have thus far failed. How
can I make 'Journal of Something' below italic but leave the rest?
mtext( "See Author1 and Author2 (2007) , \"Title\", Journal of Something ,
pp. 1-50.", side = 3, outer = T, line=-0.75, cex = 0.7, at= 0.04, adj = 0,
font = 1, family = "Times")
--
View this message in
2007 Mar 18
2
italics letter in roman string
Hi,
As part of the legend to a plot, I need to have the "n" in italics
because it is a requirement of the journal I aim to publish in:
"This study, n = 3293"
Presently I have:
legend(20, 105, "This study, n = 3293", pch=1, col=rgb(0,0,0,0.5),
pt.cex=0.3, cex=0.8, bty="n")
I suppose I could leave a blank in place of the "n",
2016 Oct 25
2
Colores en names.arg de un barplot()
Hola.
Tengo un gráfico que tiene muchos names.arg (demasiados...), de modo tal
que le vendría bien al lector usar colores intercalados, tal que el primero
sea azul, el segundo negro, el tercero azul, cuarto negro, y así. Es decir,
definir un vector "similar" a este:
rep(c("black", "blue"), length(barras[,1]/2)
que permita pintar uno y uno en este gráfico:
2006 Aug 14
1
mtext uses the typographical descender to align text
<>
Hello
One sometimes (quite often really ) marvel at the choice of defaults in
R's graphic engine.
For some obscure reason, mtext uses the typographical descender (bottom
of letters) to align text. That is: "gG" will end up slightly higher
that "GG". Depending on the font, "Q" might end up higher than "O".
(for explanation of baseline
2002 May 03
0
copy or save to metafile from graphics device shrinks plots (PR#1507)
Full_Name: Drew Tyre
Version: 1.4.0
OS: Win 2000
Submission from: (NULL) (140.253.74.225)
When creating a rather complex plot, the resulting figures 'shrink' when either
copied to the clipboard or saved as a metafile using the GUI menu. Also saving
as postscript or pdf causes the same problem, as does printing the figure
directly from the graphics window. Only the figure areas shrink,
2017 Jul 28
0
[FORGED] Re: axis() after image.plot() does not work except if points() is inserted between
Hi
I believe this is a clipping bug in the 'graphics' package.
A simpler version of the problem is this ...
plot(1:10)
mtext("margin-label", side=2, at=9, las=1, line=1, adj=0)
par(mfg=c(1,1))
## Only the text within the plot region is drawn
mtext("margin-label", side=2, at=9, las=1, line=1, adj=0, col="red")
I have committed a fix to the development
2010 Jun 04
1
strange behaviour of CairoPNG
Hi,
could it be that the text() fuction gives different output for normal
png() and CarioPNG()?
See the following example and the attached images: the font=2 and
font=3 seem to be exchanged!
Thanks for help,
Thomas
CairoPNG("Test-cairo.png",width=750,height=690)
#png("Test-normal.png",width=750,height=690)
plot(1,1,type="n",main="normal")
2008 Mar 01
1
jpeg and margin text
Hi guys,
I use R 2.6.2 and Windows XP.
I’ve got the following question: I wrote a lot of text into the margin of a
plot. When I use the “jpeg”-function, only a little part of the margin text
is displayed in the final jpeg? Any ideas to change it?
Source-Code:
datenbankdaten<-data.frame(LETTERS[1:20],
2011 Dec 09
1
Align expression and text in mtext()
Dear R-helpers,
I have trouble aligning an expression with a subscript, and text, in margin
text:
par(mar=c(6,6,1,1))
b <- barplot(1:3)
mtext(c("A","B","C"), at=b, side=1, line=1, cex=1.3)
mtext(expression(italic(C)[a]~(more~text)), at=0, line=1, side=1,cex=1.3)
As explained in the help files and elsewhere, I understand that the
expression is aligned by the
2011 Jun 24
1
try to generate graph for each element of my list
Dear all,
I have the following problem. I have a List of time series dataframe.I'm
trying to produce specific graph for each element of my list. The code is:
This is my list:
Lista_import<-lapply(Lista_import, function(x){
x2<-subset(x, select=c("ANNO","DICHIARANTE","PARTNER", "quota"))
x2<-cast(x2, ANNO+DICHIARANTE~PARTNER)
x2<-
2016 Oct 25
2
Colores en names.arg de un barplot()
Gracias, Javier. Está muy bueno el post, pero en efecto refiere a legend y
no a los names.arg
Adjunto un archivo para poder correr el gráfico. Creo que eso ayuda a
precisar el problema. Las etiquetas que aparecen al costado izquierdo de
las barras son las que quiere pintar de negro y azul.
También va a necesitar este objeto para que la sintaxis corra sin errores:
library(RColorBrewer) #Para