similar to: Multi-line plots with matrices in R

Displaying 20 results from an estimated 11000 matches similar to: "Multi-line plots with matrices in R"

2007 Mar 23
1
Space for X and Y axis labels
Hello all, I'm having a bit of a problem with x and y axis labels. Two things: first, if I want to create a plot with, plot.new() plot.window(.....) axis(1) axis(2) lines(...) points(...) [etc.] ... where do I introduce the xlab=... and ylab=... commands? I attempted this in plot.window() but no labels showed up. Second, here's a bit of real code...
2005 Jul 13
3
How to use the function "plot" as Matlab?
Hello, How to use the function plot to produce graphs as Matlab? example in Matlab: a = [1,2,5,3,6,8,1,7]; b = [1,7,2,9,2,3,4,5]; plot(a,'b') hold plot(b,'r') How to make the same in R-package ? I am trying something thus: a <- c(1,2,5,3,6,8,1,7) c(1,7,2,9,2,3,4,5) -> b a;b plot(a,t="l",col="blue") plot(b,t="l",col="red")
2000 Mar 26
1
matlines, matpoints don't follow prototype (PR#506)
The Blue Book allows the 'type' argument to be used in matpoints and matlines. matlines(x, y, type="l", lty=1:5, pch=, col=1:4) R-1.0.0 does not. Thus, type="h", "b", must be invoked thru matplot( x, y, type = "h", add=TRUE) For the sake of consistency with S, it would be nice to have matlines defined as: "matlines" <-
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,
2020 Jan 28
4
matplot.Date & matplot.POSIXct
????? Thanks for the reply. On 2020-01-27 19:56, Abby Spurdle wrote: > Maybe I'm missing something really obvious here, but I was unable to > create a matrix out of POSIXct object(s). > Perhaps that deserves a separate discussion...? ????? Can you provide an example? ????? The standard matplot application that concerns me is with matplot(x, y, ...) where x has class Date or
2002 May 29
1
bug in xfig()?
I'm using (Linux version) xfig() within a function and then simple matplot() and matline() plots. Although I do not define any bg or fg default color, sometimes all lines in the final fig file are green. The same code works as (I) expected if I use x11() or pdf(). This is what I'm doing: I open 2 devs: xfig() dev.set(2) layout(mat1) xfig() dev.set(3)
2011 Sep 12
1
Centering lines on barplot centers.
Hello, I am trying to port one of my plotting S+ functions to R and I am having difficulties!!! I am including here only the troublesome code! I first produce a barplot, saving the positions of the bar's centers. par(mar = c(6.1, 5.1, 4.1, 4.1), mgp = c(3, 3.0, 0)) ticks.loc <- barplot(sum.of.weights, col = 5, xlab = "", ylab = "", axes =
2005 Jun 20
1
RES: another aov results interpretation question
Dear All, I created a script to calculate averages - two groups: "parcel" and "date" - and, based on these averages, make a graph. The problem is that 'R' does not recognize the first column even if I try to insert one. A brief example Raw data: Data <- sample(1:100, 30, replace = FALSE, prob = NULL) Date <-
2003 Nov 24
3
Bollinger Bands
Is there a way to create Bollinger Bands without having to loop on the observations of a time serie? Any help appreciated Thanks
2020 Jan 28
1
matplot.Date & matplot.POSIXct
On 2020-01-28 05:13, Martin Maechler wrote: >>>>>> Spencer Graves >>>>>> on Mon, 27 Jan 2020 23:02:28 -0600 writes: <snip> > > Still, as Abby mentioned, turning a simple function into the > default method of an S3 generic is easy to do, but comes with a > bit of cost, not just S3 dispatch which typically is negligable in > graphics,
2009 Feb 09
2
How to plot multiple graphs each with multiple y variables
I am new to R and have a problem that I haven't been able to find the answer to in the guides or online. I have multiple datasets, D1, D2, D3, D4, D5, D6, D7 and D8, and I would like to produce two plots side by side using mfrow.  The first plot should contain data from D1-D4, the second should contain D5-D8. I can plot these separately using the code, par(mfrow=c(1,1))
2020 Jan 23
2
matplot.Date & matplot.POSIXct
Hello, All: ????? Roughly a decade ago, I added "matplot.Date" and "matplot.POSIXct" to the "fda" package, so we could get reasonable labeling of the horizontal axis when "x" was class "Date" or "POSIXct".? I also added a local version of "matplot.default" that just changes the defaults for "xlab" and
2007 Sep 16
2
Plotting (vector,matrix)
Hi all, I'm still a bit new to R and I'm trying to figure something out. I have the solution but the solution is what a C programmer would do :-) and I was wondering if someone could tell me the R way of doing it... What I have is a vector x of length |x|. And a matrix y of size m rows and n columns where n = |x|. I want to plot m * n points on a graph so that the x-coordinates
2007 Jun 26
4
Looking for parallel functionality between Matlab and R
I'm slowly moving my statistical analysis from Matlab to R, and find myself missing two features: a) How do I mimic Matlab's 'hold on'? (I want to show several plots together, when I type two plots one after the other the second overwrites the first) b) How do I mimic Matlab's 'axis'? (after drawing my plots I want to zoom on specific parts- for example, x=0:5,
2009 Mar 23
2
matplot does not considere the parametre lend (PR#13619)
Full_Name: Christophe Genolini Version: 2.8.1, but also 2.9 OS: Windows XP Submission from: (NULL) (82.225.59.146) I am using matplot with the option lend="butt", but only the first line (the black) is printed correctly : > matplot(matrix(1:9,3),type="c",lwd=10,lty=1,lend="butt") Gabor Grothendieck find the problem in matplot code: the ... is passed to plot
2005 Jul 07
2
Brewer colours
Anyone who is interested in using optimal colour palettes should look at the work of Cindy Brewer: www.colorbrewer.org I have written code to use her colour schemes in R. It is included below. Perhaps someone may find this interesting enough to work into a package. Included also is a function showpalette, which was posted here a while back. I don't remember who wrote it. I have copied all
2009 Jan 14
1
Help with Plot/Legend
Dear R-Users I have 2 questions: Firstly, If I create a matplot and legend for multiple vectors and then tag another vector on using matlines (e.g. a 'total' of all vectors), is there anyway to add the new line to the legend without recreating it? I have created the plot this way because I would like to define the lty and lwd for the 'total' vector so that it can be
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 Sep 28
1
help on plots
Dear friends, I met a problem on plotting. My dataset is : year MHBC LHBC MHRC LURC 1993 11.75 4.50 0.43 0.46 1994 7.25 1.25 0.35 0.51 1995 8.67 2.17 0.54 0.44 1996 2.67 1.33 0.78 0.47 1997 3.42 4.92 0.69 0.48 1998 1.92 3.08 0.72 0.54 1999 2.33 2.58 0.74 0.41 2000 5.75 4.50 0.45 0.50 2001 3.75 4.42 0.52 0.47 2002 2.33
2010 Jan 12
1
barplot: border color when stacked
Dear R-users, I am using R version 2.10.1 under windows. In a barplot, I want to mark one of the bars with a special border color. For example: barplot(c(3, 7, 11), border = c(NA, "red", NA)) But how to do this when the bars are stacked? for example: barplot(matrix(1:6, ncol=3)) # border of second bar (i.e. the one with total height = 7) should be red again, I try: barplot(matrix(1:6,