similar to: Plotting 2 Lines on the Same Chart

Displaying 20 results from an estimated 20000 matches similar to: "Plotting 2 Lines on the Same Chart"

2010 Jul 28
2
Axes=F and plotting dual y axes
Howdy. Been running into a bit of trouble with plotting. Seems that axes=F is not "working". Whenever I plot (either a dataframe or xts/zoo series) and I set axes=F along with xlab/ylab="" I still get the default axes printed in my chart. Consider this: #Create some sample data, both 50 units of blah series2 = c(1:50) series1 = rep(25:74) testdf1 = as.data.frame(series1)
2010 Oct 28
4
Returning highs and lows in R
I'm having trouble returning a rolling n period highest value for a data set. For each day I want to calculate the highest value over the last 3 days. I am using the following packages: zoo, xts, quantmod and TTR. Thanks, Jason GLD.Close 2010-10-01 128.91 2010-10-04 128.46 2010-10-05 130.99 2010-10-06 131.81 2010-10-07 130.37 2010-10-08 131.66 2010-10-11
2006 Oct 15
2
overlapping intervals
Hello everybody, I have two series of intervals, and I'd like to output the shared regions. For example: series1<-cbind(Start=c(10,21,40,300),End=c(20,26,70,350)) series2<-cbind(Start=c(25,60,210,500),End=c(40,100,400,1000)) > series1 Start End [1,] 10 20 [2,] 21 26 [3,] 40 70 [4,] 300 350 > series2 Start End [1,] 25 40 [2,] 60 100 [3,]
2012 Feb 28
2
ts.plot and x axes customization
Dear List, I would be pleased if someone can help me with the following issue: I'm about to plot two time series in one plot via ts.plot which looks like: ts.plot(series1, series2, main=main, xlab=xlab, ylab=ylab, col=c("green", "red", "blue"), lwd=2) The problem is, that R automatically sets the x axes labels in 5-year-intervalls. Every
2008 May 03
2
Stacked bar plot anomaly When column contains a negative and a positive value
Hello users, I've noticed a problem when creating a stacked column plot when a column contains a negative and a positive value. e.g. series1<-c(-1,-2, 3, 4, 5) series2<-c( 5, -4,-3,-2, 1) data<-rbind(series1,series2) barplot(as.matrix(data), beside=FALSE) In these cases (i.e. first, third and fifth columns) the plotting is not handled correctly. Compare this output with that
2010 Jan 27
1
How to sort data.frame
Dear R heleprs   Suppose I have following data   Scenarios combination_names     series1    series2 Sc1 MAT2 GAU1 7.26554 8.409778 Sc2 MAT2 GAU2 7.438128 8.130275 Sc3 MAT3 GAU1 8.058422 8.06457 Sc4 MAT1 GAU2 8.179855 8.022071 Sc5 MAT3 GAU2 8.184033 8.191831 Sc6 MAT3 GAU2 7.50312 8.232425 Sc7 MAT1 GAU2 7.603291 8.200993 Sc8 MAT1 GAU1 8.221755 8.380097 Sc9 MAT3 GAU2 7.904908
2006 Jun 20
1
weird application of apply again
uugh : i promise that this will be my last question of the day. i hate to constantly bother this group but it takes me time to get familar with all of these functions, tricks and and manipulations. i appreciate everyone's patience. i used too splus a lot but i've gotten rusty. i have a matrix of say 200 rows and 600 columns. i have a function "getprofit" that takes two series
2005 Oct 19
1
Plotting more than one series on the same graph
I'm new to R and have searched for help and consulted the the pdf manuals, but I can't seem to figure out how to plot more than one series on the same graph. I've tried using multiple par(new=TRUE) statements such as >plot(series1, ci.type="line", col="red", lwd=2, ci.lty=0, ci.col="red") >par(new=TRUE) >plot(series2, ci.type="line",
2004 Apr 29
1
accessing information in lists
I've created a dataframe containing multiple ACF lists through the command rev.acf<-apply(rev.matrix, 2, acf, na.action=na.contiguous, lag.max=12, plot=FALSE) where rev.matrix is an n by t matrix containing n time series in columns. I'd now like to pull out only the ACF information and store it in a seperate n by 12 matrix. So far the only way I can work out to access this is
2006 Mar 17
1
How to change the label in plot.ts ?
Hi you guys: I have been wondering if there is any way to change the labeling in plot.ts( ), for example , if I plot two sequences, i always got y labels as "series1", "series2", I tried to use ylab=c((expression(mu_1)),(expression(mu_2))), but it doesn't work. thanks in advance for any help best.
2011 Nov 28
1
Plotting a zoo object: lines and barplot
Dear R users, I have 3 columns in a zoo object. I want to plot all of them in one screen but I want the first two to be in "lines" format and 3rd one to be barplot. Regards Vikram [[alternative HTML version deleted]]
2018 Jan 28
2
Plotting quarterly time series
I have a data set with quarterly time series for several variables. The time index is recorded in column 1 of the dataframe as a character vector "Q1 1961", "Q2 1961","Q3 1961", "Q4 1961", "Q1 1962", etc. I want to produce line plots with ggplot2, but it seems I need to convert the time index from character to date class. Is that right? If so, how
2010 Oct 24
2
If Statement Help
Price 2010-10-11 99 2010-10-12 101 2010-10-13 102 2010-10-14 103 2010-10-15 99 2010-10-18 98 2010-10-19 97 2010-10-20 101 2010-10-21 101 2010-10-22 101 I have this dataset and I only want to return instances when the Price is > 100. If I use the code: Price > 100 then it will evaluate each entry as "TRUE" or "FALSE". What is the code
2018 Jan 28
1
Plotting quarterly time series
Using Achim's d this also works to generate z where FUN is a function used to transform the index column and format is also passed to FUN. z <- read.zoo(d, index = "time", FUN = as.yearqtr, format = "Q%q %Y") On Sun, Jan 28, 2018 at 4:53 PM, Achim Zeileis <Achim.Zeileis at uibk.ac.at> wrote: > On Sun, 28 Jan 2018, phil at philipsmith.ca wrote: > >> I
2012 Jul 27
1
Working with quantmod chartSeries and plot.zoo
Hi all, I'm a newbie to R and it has been very helpful to use your website. Unfortunately I've been struggling with my code now for two days so I wanted to ask few questions. I've been trying to create nice graphs to put into a pdf sheet but I'm having little problems with all the packages I've been using. So what I want to accomplish is create one pdf sheet with three graphs
2018 Jan 28
0
Plotting quarterly time series
On Sun, 28 Jan 2018, phil at philipsmith.ca wrote: > I have a data set with quarterly time series for several variables. The > time index is recorded in column 1 of the dataframe as a character > vector "Q1 1961", "Q2 1961","Q3 1961", "Q4 1961", "Q1 1962", etc. I want > to produce line plots with ggplot2, but it seems I need to
2010 Nov 03
4
Drawing circles on a chart
Dear Group, I have the following data matrix which is a timeseries. > dput(tData) structure(list(A = c(0.2, 0.13, 0.05, 0.1, 0.02, 0.18, 0.09, 0.06, 0.13), B = c(0.15, 0.06, 0.09, 0.02, 0.03, 0.12, 0.01, 0.15, 0.06), C = c(-0.1, 0, -0.07, -0.06, -0.05, -0.05, -0.06, -0.08, -0.07), D = c(-0.15, -0.05, -0.1, -0.03, -0.13, -0.04, -0.1, -0.04, -0.15), E = c(-0.17, -0.16, -0.08, -0.07, -0.09,
2010 Dec 21
1
How to suppress plotting for "xyplot(zoo(x))"?
Hi, I found the thread http://r.789695.n4.nabble.com/Matrix-as-input-to-xyplot-lattice-proper-extended-formula-syntax-td896948.html I used Gabor's approach and then tried to assign the plot to a variable (see below). But a Quartz device is opened... why? I don't want to have anything plot/printed, I just would like to store the plot object. Is there something like "plot =
2012 Mar 22
1
Questions on plotting using zoo toolbox: (1) dual axes (2)legend
Hi, I have three time series and I would like to plot them on the same graph such that two of them share left y-axis and the third uses right y-axis. rm(list=ls()) library(zoo) x1 <- read.csv(file="120322DBCdata.csv", header=TRUE) x1date<-as.yearqtr(1979)+seq(0,nrow(x1)-1)/4 x1zoo<-zoo(x1, x1date, frequency=4) x1zoodata<-cbind(x1zoo$D4GDP, x1zoo$D4NE,
2010 Sep 23
4
plotting multiple animal tracks against Date/Time
Dear list, I would like to create a time series plot in which the paths of several individuals are stacked above each other, with the x-axis being the total observation period of three years ( 1.1.2004 to 31.12.2007) and the y-axis being some defined range[min,max]. My data consist of Date/Time information and the paths of 45 individual as the distance from the location of release. An example