similar to: plotting many line segments in different colors

Displaying 20 results from an estimated 30000 matches similar to: "plotting many line segments in different colors"

2007 Nov 13
2
Plot segments with different colors
Hello Everybody, I'm trying to plot(x,y) using different colors. I have to cut (x,y) into sub intervals. And I want to plot this sub intervals using colors. But infortunally I don't know how to do this with R. Can any body help me please? My code is looking like : x<-c(tvar[1:t0],tvar[t0:(ts)],tvar[ts:n]) F<-c(var[1:t0],var[t0:(ts)],var[ts:n]) plot(x,F,xlab="Zeit
2011 May 02
2
Help with coloring segments on a plot
Hi. I need a very short piece of help regarding colouring segments plotted on a graph. When I am plotting segments for the graph, I am using "red" and "darkgreen for the values "1" and "2" respectively. Heres the relevant line of code in R: + col = c("red", "darkgreen")[line.colour.value]) I just need to extend this to refer to a larger
2002 May 21
1
plotting functions with line width (lwd) as vectors
If I want to plot different widths of line segments or arrows I have to program loops to plot each line apartly. Is that right? n <- 6 x <- 1:n y <- rnorm(1:n) q <- ( x %% 3 + 1 ) * 2 plot( x, y, cex=q ) for( i in 1:(n-1) ) lines( x[i:(i+1)], y[i:(i+1)], lwd=q[i], col=q[i] ) Would it not be possible to make plotting functions accept vectors of line widths (as they
2004 Sep 17
1
Confused about specifying plot colors as RGB values
Based on reading 'rgb' documentation, I would have thought the following would have produced identical results. Can someone explain how to make this happen? I need to be able to specify an array of rgb values for the 'col' parameter. colnames.col <- c("black", "red", "blue", "green") colnames.rgb <- apply(as.matrix(colnames.col), 1,
2009 Mar 29
2
number of ticks in a persp() plot
Hi, I am trying to specify four ticks (at 0,1,2,3 for the y axis) in a persp plot but the defaults overrule my specification and I obtain seven of them. Is it possible to gain full control over them in such a plot? Here is my code: matlines=matrix(c(1:7,3:9,3:9,2:8),nrow=7,ncol=4)
2012 Nov 04
2
lines with colored segments
Hello all I'm trying to create a plot similar to a plot.default(..., type='b') with points plotted connected by lines that leave small gaps between the end of the line and the point symbol, BUT, with each line segment's color controlled by a category. plot... draws the line color uniformly according to the first color in a color sequence, ignoring the remainder. I can use
2005 Feb 23
1
basic question about changing limits on generated plots
Is it possible to change the limits on plots that are already on the screen? In particular, is there any R equivalent to the sequence of matlab commands plot(1:10,1:10) hold on plot(2:12,5:15) I know I can use points and lines to add points and lines to plots, but the limits of the plot do not change when I do this. Looking at various examples, it seems that the answer is "no", but I
2011 Aug 15
2
plotting segments only and in color
Hello, I've a question concerning the display of interval data. A sample dataset where X is an interval between Xa and Xb which should be displayed: Y=c(15,14,23,18,19,9,19,13) Xa=c(17,22,21,18,19,25,8,19) Xb=c(22,22,29,34,19,26,17,22) X = (Xa+Xb)/2 It's easily possible to plot the mean of the interval like: plot(X,Y) afterwards I can create lines for the interval with:
2004 Jun 11
2
Asterisk newbie help !!
hi, I got a digit networks x100p card and instaled asterisk. everything went fine and upon calling the phone asterisk issues a notification. Now i plan to turn it into an ivr and modified extensions.conf to first record some messages , problem is 1-)I am not able to understand how extensions refer to in my case ( a single analog phone line plugged into line jack and a phone into the phone
2011 Aug 05
3
plotting many unique colors with categorical data
Hi- I am trying to plot a matrix of categorical values across time using color to represent each individual factor. For example: 1982 1983 1984 1985 1986 1987 1 19 19 68 68 19 19 68 2 68 68 19 19 68 68 19 3 26 26 34 34 26 26 26 4 57 34 57 57 34 57 34 5 34 57 26 26 57 34 57 6 28 28 28 28 28 58
2008 Jul 20
4
drawing segments through points with pch=1
Please excuse me for asking such basic questions: Here is my code > y=c(1.21,0.51,0.14,1.62,-0.8,0.72,-1.71,0.84,0.02,-0.12) > ybar=mean(y) > ll=length(y); > ybarv=rep(ybar,ll) > x=1:ll > plot(x,ybarv,pch=1) > segments(x[1],ybar,x[ll],ybar) What I get is a collection of small circles, with a segment "on top" of the circles, which is almost what I want. But I
2003 Jul 15
3
Plotting a graph of many lines between groups of points...
I have a data file read into a data frame. For example, V1 V2 V3 V4 1 1 1 3 4 2 2 3 5 10 . . . . . . . . . . n V1[n] V2[n] V3[n] V4[n] to n=many thousand I want to plot a graph with many line segments, where v1[i]=x1, v2[i]=y1, v3[i]=x2, v4[i]=y2 for i=1,n. This seems relatively simple in theory but I've spent quite a bit of time trying to make it happen with
2009 Mar 12
3
help with predict and plotting confidence intervals
Dear R help, This seems to be a commonly asked question and I am able to run examples that have been proposed, but I can't seems to get this to work with my own data. Reproducible code is below. Thank you in advance for any help you can provide. The main problem is that I can not get the confidence lines to plot correctly. The secondary problem is that predict is not able to find my object
2006 May 09
2
draw a graphic using segments to represent data
Hello, I'd like to draw a graphic using different color line segments to represent microarray data. It simply likes this: Data=cbind(c(1, 2, -1, 3, -2.2), c(1, 3, -1, -1.8, 4)) The first col No represents y'axis position (negative down and positive up). The second col No represents a length of segment (negative segment should be on left of y, and positive on right). Also the
2011 Mar 08
4
minimum distance between line segments
Dear R helpers, I think that this may be a bit of a math question as the more I consider it, the harder it seems. I am trying to come up with a way to work out the minimum distance between line segments. For instance, consider 20 random line segments: x1 <- runif(20) y1 <- runif(20) x2 <- runif(20) y2 <- runif(20) plot(x1, y1, type = "n") segments(x1, y1, x2, y2)
2009 Jul 14
5
plotting confidence intervals
Hi R People: If I have a fitted values from a model, how do I plot the (1-alpha)100% confidence intervals along with the fitted values, please? Also, if the intervals are "shaded" gray, that would be nice too, please? I check confint, but that doesn't seem to do what I want. Thanks in advance, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and
2011 Feb 07
3
Giving vector of colors to line in plots
Hey all, I can't for the life of me figure out what I'm missing here. I'm trying to change the color of the line in a time series type plot. I can change the point colors and symbols no problem, but for some reason the colors do not get passed to the lines, regardless of if I do type="b" or type="l". The sample code I'm using is below. Any help would be
2007 Mar 07
2
Multi-line plots with matrices in R
Hello all, I'm a new user of R, experienced with Octave/MATLAB and therefore struggling a bit with the new syntax. One of the easy things in Octave or MATLAB is to plot multiple lines or sets of points by using a matrix where either the columns or the rows contain the y-values to be plotted. Both packages automatically give each line/points their own unique colour, character etc. I'm
2008 Nov 20
1
Vector lty argrument for lines or plot
I am confused by the behavior of the lines function when the lty argument is a vector. ?lines indicates that lty is a valid parameter, but says nothing else about it. ?plot.xy (which I think is what gets called) refers back to ?lines. ?plot.default says to see ?par. In ?par, about lty it says "Some functions such as lines accept a vector of values which are recycled. Other uses will take
2010 Apr 18
2
plotting pca of samples in different colors
Hi! All, I am working on a dataset 'rat' with dimension 20500x363. I have calculated pca of samples (columns). Now I am trying to plot first two principle components with specified columns in different color. I have done following so far: > dim(rat) [1] 20500 363 >#specifying columns to be colored in red >