similar to: mysterious extra spaces appearing in expression paste

Displaying 20 results from an estimated 4000 matches similar to: "mysterious extra spaces appearing in expression paste"

2011 Jul 18
2
line jump in plot legend title
Hello, In order to reduce the width of my legend in a plot I introduced line jumps in the title. Here's the problem; the legend box hasn't adapted accordingly and part of the title is printed out of the frame. See the example below: plot(1:10) legend("bottomright", bg="white", fill=c(7,8,12,13,19),
2009 Jan 14
4
How to get legend outside of plot?
I am creating a CDF plot function more user-friendly than any default r function. Depending upon the bimodality of the data (it is often bimodal), or any other strange data trends, the points can end up gathering in just about any corner of the plot. So, when I add a legend, whether I choose to add it in the bottom right, top left, or wherever, it will sometimes end up putting the legend right
2023 Mar 06
1
legend: interplay between title and y.intersp
Hi, I think you are right, legend cannot do it. I have now created my own legend function where I changed only one line and now it works the way I want it to. But I'm not sure if that might not have other side effects. I have the impression that the legend and the title start at the same y-position (try y.intersp=0). Only if y.intersp is big enough, then it leads to a non-overlap of
2012 Mar 30
1
avoiding expression evaluation when calling a function
Another question on functions - I have something that looks like plotter<-function(i){ temp.i<-rwb[rwb$vector1 <=(i*.10),] with(temp.i, plot(vector2, vector3, main=(i*.10),)) mod<-lm(vector3~vector3-1,data=temp.i) r2<-summary(mod)$adj.r.squared rsqrd[i]<-r2 legend("bottomright", legend=signif(r2), col="black") abline(mod) rsqrd<<-rsqrd } I'd
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
2023 Mar 04
1
legend: interplay between title and y.intersp
Set the legend position explicitly with x and y values and add xpd = TRUE to the legend call to clip the plot to the figure region and not the plot region (the default). Something like this (you may have to fool around with y.intersp, etc. to allow enough space between the legend lines): plot(c(0,1), c(0,1), type="n") legend(x = .4, y = 1.25, legend=c("", "",
2010 Oct 06
4
problem with abline
Hi All, I am running a scatter plot and trying to add a best fit line. I use an abline function, but get no line drawn over the points. I also get no error. I arm using V 2.10.0 on Windows 7. Here is my code, including the SAS transport file import: require (foreign) require (chron) require (Hmisc) require (lattice) clin <- sasxport.get("y:\\temp\\subset.xpt") attach(clin)
2023 Mar 06
1
legend: interplay between title and y.intersp
What about plot(c(0,1), c(0,1), type="n") legend("top", legend=c("", "a", ""), col=c("blue", "red", "green"), title="test", y.intersp=c(1,-0.4), lwd=1) (in recent versions of R) Best, Uwe On 06.03.2023 11:34, Sigbert Klinke wrote: > Hi, > > I think you are right, legend cannot do
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",
2012 Oct 05
1
Format of numbers in plotmath expressions.
I want to do something like: TH <- sprintf("%1.1f",c(0.3,0.5,0.7,0.9,1)) plot(1:10) legend("bottomright",pch=1:5,legend=parse(text=paste("theta ==",TH))) Notice that the final "1" comes out in the legend as just plain "1" and NOT as "1.0" although TH is [1] "0.3" "0.5" "0.7" "0.9"
2009 Nov 30
1
Continuous legend colors
Dear List, I am trying to get a basic plot to show a continuous range of fill colors. It is probably easiest to demonstrate. I would like a legend like in the following example: Satellite.Palette <-colorRampPalette(c("blue3","cyan","aquamarine","yellow","orange","red")) require(fields) image.plot(volcano, col = Satellite.Palette
2023 Mar 04
1
legend: interplay between title and y.intersp
Hi, my MWE is not working as expected: plot(c(0,1), c(0,1), type="n") legend("top", legend=c("", "", "a"), col=c("blue", "red", "green"), title="test", y.intersp=0.2, lwd=1) The lines are not below the title. I want (nearby) lines as in the plot, but below the title. Is there a way to achieve this?
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
2012 Apr 01
1
indexing in a function doesn't work?
Hello, I've written a small function that's supposed to save me some time, and it's ending up killing it- the intention is to iteratively subset a dataset fram on framevec, fit a model (either lm or nls depending on type) and return the r2 or AIC from the model, respectively. Although as far as I can tell in my code the plots are dependent on the fit of the model to the data and the
2008 Dec 22
0
Align legend title
Dear R developers, I needed to align the title of legend for some of my plots. If there is interest to include this into base R, bellow are the examples and the relevent diffs. Regards, Gregor x <- 1:10 y1 <- 1.5 * x y2 <- 2.0 * x y <- cbind(y1, y2) source(file=url("http://gregor.gorjanc.googlepages.com/legend.R")) matplot(x, y, type="l", lty=c(1, 2)) ##
2011 Jul 25
1
Creating png of layered legend
I am trying to create a plot that has multiple plot characters for each point (e.g. a point within a triangle, a triangle within a square, etc). The workaround I have found to do this is by plotting twice, as in this example: x <- c(1.1, 2.3, 4.6) y <- c(2.0, 1.6, 3.2) plot(x, y) points(x,y, pch=20, col="red", cex=0.5) This works, but perhaps there is a better way to do it in one
2006 Feb 09
7
putting text in the corner
I want to write some text in a corner of my plot. Is it possible to get the xlim and ylim of an open window? Or is there anything similar like legend(x="bottomright", inset=0.01,legend=...) for text(x=1,y=2, "test") Thomas
2009 Mar 24
2
Legend containing maths symbol and values of variables
I need to have the maths symbol for >= in the legend, and to substitute threshold variable with its value. Somehow, various attempts weren't successful. Please help. threshold <- 0.5 plot(NA, xlab="", ylab="", main="", axes=F, xlim=c(0,1), ylim=c(0,1), xaxs="i", yaxs="i") legend(x=0, y=1, fill=c("orange", "white",
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
2016 Oct 26
2
borrar texto en una gráfica
Hola a todos, Os envío una consulta que considero sencilla pero me está resultando imposible de resolver. Si ejecutáis el siguiente código, obtendréis la gráfica que os adjunto: library(ltm) modelo <- rasch(LSAT) plot(modelo, main="Curva probabilidad pregunta 1",legend = TRUE, cx = "bottomright", items=1,xlab="Conocimiento",ylab="Probabilidad") Resulta