similar to: How to add grid lines at specific position to a plot?

Displaying 20 results from an estimated 10000 matches similar to: "How to add grid lines at specific position to a plot?"

2006 Jun 19
1
lattice xyplot - aligning date labels so that they align with the grid lines in panel.grid
Hi, I have a basic question about aligning date labels for the x-axis in an xyplot so that they align with the grid lines from the panel.grid argument. For example, with x <- data.frame( date = seq(as.Date("2005/01/01"), as.Date("2006/06/01"), length.out = 20), value = runif(20)) xyplot(value ~ date, data = x, panel = function(x, y, subscripts, ...) {
2008 Sep 25
1
grid.newpage()
Hi, I'm trying to customize a window with 2 graphs. I'm able to do the first one with something like this general example par(mfrow=c(1,2),cex.axis=0.85,cex.lab=0.80,mai=c(1.3,1,0.5,0),las=3) bplot<-barplot(bar.values,names.arg=cf.names,width=0.5,ylab="% Area held") abline(h=0.3,lty=3,col="red") abline(h=0.1,lty=3,col="blue")
2019 Feb 28
2
R cairo_pdf function does not respect plotting boundaries
Hello all, When producing a plot in R using the cairo_pdf device, the resultant plot does not respect the plotting boundaries. Lines and shaded regions will spill over the lower x-axis and the right-side y-axis (sides 1 and 4). I would like to know if it is possible to fix this behaviour when using 'cairo_pdf' in R? As an example, see the image at this web link:
2019 Feb 28
2
R cairo_pdf function does not respect plotting boundaries
Hello all, When producing a plot in R using the cairo_pdf device, the resultant plot does not respect the plotting boundaries. Lines and shaded regions will spill over the lower x-axis and the right-side y-axis (sides 1 and 4). I would like to know if it is possible to fix this behaviour when using 'cairo_pdf' in R? As an example, see the image at this web link:
2004 Apr 27
1
helps on levelplot
I'm a new user of levelplot, and are not familiar with the terminology very well. Is the bar alongside the levelplot indicating color or shade call "colorkey"? I have to adjust the size of its label, but couldn't make it so far. This is how I did: levelplot(z~x*y, grid, at=seq(0,1,by=0.1), colorkey=list(labels=list(cex=2))) But I got error message "Error in
2008 Mar 28
1
background color in scatterplots
Dear R community, I have a scatterplot with multiple vertical ablines. I wish to color each interval between two ablines in a different color... Could you please indicate me how to do this efficiently? Thank you! Georg. ******************** Georg Ehret Johns Hopkins Baltimore [[alternative HTML version deleted]]
2010 Nov 27
1
How to add multiple ablines
Hi folks Run; > ToothGrowth > attach(ToothGrowth) > toothgrowth=lm(len~dose) adding abline: > abline(toothgrowth) I got it done adding single abline. How to add more ablines on the same diagram? I found following thread, applying "mapply" command; Plotting multiple ablines http://www.mail-archive.com/r-help@r-project.org/msg51543.html mapply(abline, (converge$kY +
2019 Mar 05
1
[R] [FORGED] R cairo_pdf function does not respect plotting boundaries
Hi (cc'ed to r-devel where further discussion should probably take place) Thanks Lee. I see that problem. There is a "+ 1" in the Cairo device code for setting the clipping region (https://github.com/wch/r-source/blob/ba600867f2a94e46cf9eb75dc8b37f12b08a4561/src/library/grDevices/src/cairo/cairoFns.c#L156) Remove the "+ 1" and the problem goes away (for your example
2012 Jan 20
3
abline by groups
Hello, I have 2 variables - x and y, that belong to separate groups. I want to plot all the x and y together, but show separate abline for each group. It can be done in ggplot2, but is there a simpler way to draw ablines by group? e.g., mydata <- data.frame(x = 1:20+rnorm(20, -3, 1), y = seq(1,20,by=1), group = rep(letters[1:5],20)) plot(x,y,col=mydata$group) # need to get separate ablines
2002 Apr 20
2
integration of a discrete function
Dear R list I am looking for a function in R that computes the integration of a discrete curve, such as a power spectrum, in a specified interval (in my case, that would be 'power in a certain frequency band'). I found only functions, such as 'integrate', that perform adaptive quadrature on analytic functions, and not on a curve specified as a set of (x,y) pairs. I have the
2004 Nov 23
1
Interactive plots in R?
Hi all, As part of a research project we are creating a statistical software tool and will be using R as the computational engine. I was wandering whether we should also use R for plotting. R has a good plotting flexibility and an extensive library of available plot types. However, our application is supposed to give our users an advanced look-and-feel as well. For the plotting we will
2012 Sep 18
4
add reference lines (or grid) in background
Dear all, Is there a simple way to add reference lines in background? I am trying with abline() or grid() but the lines, since they are executed after the plot function, are draw on top. How can I draw such lines beneath the main plot? Here is an example: x<-rnorm(100) boxplot(x) abline(h=c(-1,0,1)) grid(NA, 4, lwd = 2) regards, Luigi Marongiu, MSc [[alternative HTML
2018 Jan 29
2
Add ablines
Good morning, I have some problem adding ablines in Rstudio. The lines drew by the software doesen?t match with the added values, what can I do? pfaOK<-qcc(D[!trial], sizes=size[!trial], type="p", nsigmas=2, data.name="Polli positivi al Campylobacter") pfaOK1<-qcc(D[!trial], sizes=size[!trial], type="p", data.name="Polli positivi al Campylobacter")
2011 Jun 12
2
Side by side scatter plots with specified regression lines
I am new and self taught in R, so please bear with me. I want to create two scatter plots side by side. The data set includes measurements from two different countries with 7 treatments over a timeline (x-axis). Problem 1 I want to have each plot to include the data from one of the countries with 7 regression lines of the treatments, but I do no know how to divide the data between them. This is
2009 Aug 13
1
"helper" lines in plot. From point to axis.
This is a very basic question. I am just wondering if there is a function where i can choose a vector of points, and them helper lines are drawn. I am asking because lines seams to be a cumbersome way to do this. E.g. x <- 1:36 plot(log(x,1.1),xlab="Number of months", ylab="Visits(1000)",main="webpage visits") abline(h=log(12,1.1),col="red",lty=2)
2012 Aug 28
3
date in plot, can't add regression line
Hello all, I have been using R for about 3 weeks and I am frustrated by a problem. I have read R in a nutshell, scoured the internet for help but I either am not understanding examples or am missing something completely basic. Here is the problem: I want to plot data that contains dates on the x axis. Then I want to fit a line to the data. I have been unable to do it. This is an example of
2011 May 03
2
Controlling the extent of ablines on plot
Hi all, I'm attempting to make a quite-specific plot where the axes cross at the origin and with gridlines for guidance. I've been using ablines to create the reference lines because I want a lot of control as to where they are placed on the axis. This command works very well for such control. However... These ablines don't seem to work when I specify the origin as 0,0. They go
2012 Sep 03
3
Horizontal grid in background of barplot
All, I have: x <- matrix(c(22,3,6,69,9,4,7,81,23,4,22,50),nrow=3,byrow=TRUE) rownames(x) <- c("Cold or flu","Headache","Backache"); colnames(x) <- c("Went to doctor","No response","Did nothing","Self-medicated") x <- t(x) print(x) barplot(x,beside=TRUE, ylim=c(0,90), xlab="Ailment",
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 =
2009 Feb 03
2
Lattice histogram with vertical lines
I would like to add some vertical lines to a lattice plot of histograms. What I am after is a lattice version of abline(v = 1234). The lattice histogram plot is just: histogram( ~ LTSE | approach, data = arrivals) Can anyone point me in the right direction for this? David Scott _________________________________________________________________ David Scott Department of Statistics The