similar to: Problems with segments and multiple graphs

Displaying 20 results from an estimated 6000 matches similar to: "Problems with segments and multiple graphs"

2010 Dec 02
4
2D Random walk
I've wrote some code to simulate a random walk in 2 dimensions on a lattice. Basically I want to add something in to make it plot it point by point so you can see what is going on. Heres my code for the random walk in 2d RW2D<-function(N) { i<-0 xdir<-0 ydir<-0 xpos<-vector() xpos[1]<-xdir ypos<-vector() ypos[1]<-ydir for (i in 1:N-1)
2003 Nov 04
2
help with nomogram function
I have fitted a logistic regression model > failed.lr2$call lrm(formula = failed ~ Age + task2 + Age:task2, data = time.long, na.action = na.omit) using the Design package functions and would like to generate a nomogram from this model. the datadist information is generated and stored in > ddist time.long$Age time.long$task2 Low:effect 45
2005 Apr 13
3
A suggestion for predict function(s)
Maybe a useful addition to the predict functions would be to return the values of the predictor variables. It just (unless there are problems) requires an extra line. I have inserted an example below. "predict.glm" <- function (object, newdata = NULL, type = c("link", "response", "terms"), se.fit = FALSE,
2010 May 30
2
geom_ribbon removes missing values
Hi everyone, it looks like geom_ribbon removes missing values and plots a single ribbon over the whole interval of x values. However, I'd rather want it to act like geom_line, that is, interrupt the ribbon for the interval of missing values and continue once there are new values. Here's an example: library(ggplot2) df <- data.frame( date = seq(from = as.Date("2010-05-15"),
2010 Apr 04
4
ggplot2 geom_rect(): What am I missing here
Hi R fans, As a newbie following the five-hour rule (after hitting my head against the wall for five hours, post to this list), I am appealing for some help understanding geom_rect() in ggplot2. What I want to do is very simple. I want to generate a plot of rectangles. Each one represents a business cycle. The x-values will be pairs representing the start and end of each cycle. The y-values
2003 Sep 17
1
plot.hclust: dendrogram too large for window (PR#4197)
plot.hclust: Setting up a window for a dendrogram assumes the first link is the shortest and the last is the longest. This is not always the case when the clustering was done with hclust, method="median" or method="centroid", and the dendrogram sometimes doesn't fit within the window. I propose the fix listed below. src/main/ --- plot.c Wed Sep 17 01:03:39 2003 +++
2012 Feb 03
1
incomplete final line found on <name of my sourced function file>
Dear R-ers, I hope there is a really simple solution to my problem. I've written a function that I saved in an .r file. I source this file in my code. For a while it worked fine. But then when I run the line: source("F mylineplot.r") I started getting a warning: In readLines(file) : incomplete final line found on 'F mylineplot.r' I have no idea why - I tried to check and
2008 Jul 29
4
Graphics function question
Hello I have created a graph using the following commands: <<< startBReP3O1T <- diffs$BReP3O1T - diffs$diff_BReP3O1T endBReP3O1T <- diffs$BReP3O1T x <- seq(47,89, length = 10) ymin <- min(min(startBReP3O1T), min(endBReP3O1T)) ymax <- max(max(startBReP3O1T), max(endBReP3O1T)) y <- seq(ymin, ymax, length = 10) plot(x,y, type = 'n', xlab = 'Age', ylab =
2008 Jul 30
1
read XML
I have a xml exported by Manifold GIS but I'm not being able to import it into R using XLM package. The file have this structure: <?xml version="1.0" encoding="UTF-8" ?> - <layout> <name>Layout 2</name> <pagesByX>1</pagesByX> <pagesByY>1</pagesByY> - <elements> <legend
2002 Feb 15
2
Reordering factor levels
I would like to define the order of the levels of a factor. The relevel function would work but since I have 20 levels I would prefer to declare the order explicitly. Using a smaller example levels(oldfactor) "b1" "b2" "r1" "r2" nufactor <- order(oldfactor,order=c("b1","r1","b2","r2")) # my fabricated function
2011 Jul 01
1
highlighting clusters in a heatmap
I would like to draw horizontal or vertical lines on a heatmap to highlight the clusters at some specified cut depth of the dendrogram. As a hacked example, the following code would work if I could set the coordinates of the top and bottom of the false color image correctly (ymin and ymax), but the correct values seem to depend on the output device and its size. I realize that heatmaps use a 2x2
2009 Aug 06
2
Ylim
Hello All: Can anybody tell me what is the problem with my program please. I have an error message as appears below. My program is: ifn <- "Jul08_09.LM" data <- read.table(ifn) ofn <- "Jul.png" bitmap(ofn, type = "png256", width = 30, height = 30, pointsize = 30, bg = "white",res=50) par(mar=c(5, 5, 3, 2),lwd=5)
2010 Nov 04
5
ggplot output
Dear All, I have this script: dat <- data.frame(Month = hstat$Date,C_avg = hstat$C.avg,C_stdev = hstat$C.stdev) ggplot(data = dat, aes(x = Month, y = C_avg, ymin = C_avg - C_stdev, ymax = C_avg + C_stdev)) + geom_point() + geom_line() + geom_errorbar() dat <- data.frame(Month = hstat$Date,K_avg = hstat$K.avg,K_stdev = hstat$K.stdev) ggplot(data = dat, aes(x = Month, y = K_avg,
2011 Jan 24
1
ggplot2 - ribbon
Dear List, I am having trouble setting the transparency of a ribbon in ggplot2 and was wondering if anybody had any suggestions so far i have a plot exactly as i want it and i want to add a ribbon connecting the ymax and ymin, whci i do with the following command m10 + stat_summary(geom="ribbon", fun.ymin="min", fun.ymax="max") However the ribbon is a dark grey
2012 Jul 26
2
Error Bars ggplot2
Hello, I'm attempting to plot error bars side by side rather than stacked on top of each other with ggplot2. Here is the sample code I am using: #Code #Data spd<-c("s","f","f","s","f","s","s","s","f","f","s","f") r<-c(4.9,3.2,2.1,.2,3.8,6.4,7.5,1.7,3.4,4.1,2.2,5)
2010 Sep 16
1
plotting time series using ggplots
Hi, I would like to plot a bunch of tree ring width data (time series) using ggplots, but I'm having trouble figuring out how to do it. My data is in a data.frame, with years as rownames and a distinct tree ring series in each column. So, something like this: rwl<-matrix(rnorm(800), nrow = 100) colnames(rwl) <- paste('V', 1:8, sep = '')
2013 May 14
1
Tamaño plots y calidad en grafico ggplot
Hola a tod en s, bueno, un poco al hilo de un mensaje anterior, reformulo la pregunta y pongo código completamente reproducible, a ver si hay más suerte. Estoy con un informe y hay que hacer algunos gráficos con datos diferentes con ggplot2, y hay que poner el mismo tamaño para todos ellos. El problema es que R cambia automáticamente el tamaño del área de trazado y el margen en función de
2010 Jun 15
2
Unspecified [upper] xlim/ylim?
Greetings! I would like to be able to specify a fixed (say) lower limit for plotting, while leaving the upper limit "floating, when plotting. The context is that the maximum in the data to be plotted is unpredictable, being the consequence of a simulation, whereas I know that it cannot be less than (say) 0; and I want to fix the lower limit at 0 in any plot, leaving the upper limit to be
2020 Oct 26
0
How to shade area between lines in ggplot2
Hi Put fill outside aes p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2], ymax = slope_1*x + intercept_1 + 1/w[2]), fill = "blue", alpha=0.1) The "hole" is because you have two levels of data (red and blue). To get rid of this you should put new data in ribbon call. Something like newdat <- trainset newdat$z <- factor(0) p+geom_ribbon(data=newdat, aes(ymin =
2023 Aug 12
1
geom_smooth
G'day Thomas, On Sat, 12 Aug 2023 04:17:42 +0000 (UTC) Thomas Subia via R-help <r-help at r-project.org> wrote: > Here is my reproducible code for a graph using geom_smooth The call "library(tidyverse)" was missing. :) > I'd like to add a black boundary around the shaded area. I suspect > this can be done with geom_ribbon but I cannot figure this out. Some >