similar to: Add a vertical arrow to a time series graph using ggplot and xts

Displaying 20 results from an estimated 2000 matches similar to: "Add a vertical arrow to a time series graph using ggplot and xts"

2016 Apr 18
0
Add a vertical arrow to a time series graph using ggplot and xts
Hi, I am trying to add a vertical arrow (from top to bottom or from bottom to up) to a time series plot using ggplot2 and xts. It seems that the vertical line command "geom_vline" does not work for this purpose (Correct me if I am wrong). I try the command "geom_segment" as follows, but I got an error message at the last line "Error: Invalid input: date_trans works
2013 Mar 15
0
ggplot2, arrows and polar coordinates
Dear R users, The following issue has been already documented, but, if I am not mistaken, not yet solved. This issue appears while trying to plot arrows with "geom_segment" (package ggplot2), with polar coordinates ("coord_polar"). The direction of some arrows is wrong (red rectangle). Please find herewith an example. Does someone know how to deal with that issue? Best
2009 Aug 10
2
ggplot: colours to geom_segments
Just as an exercise I am tying to add colours to a geom_segment command. I can get one colour but not a sequence of colours. Can anyone suggest how I can get the green lines in the plot below to be different colours? I thought I could use a palatte of colours but that did not seem to work. Thanks ========================================================================= library(ggplot2) xx
2012 Dec 12
1
ggplot: geom_line with only pairs of points connected
Dear list, I've been using plotmeans {gplots} a lot before, and found the "connect" argument to be quite useful. I've moved to ggplot for several reasons, but would still like to connect lines conditionally, somehow. Is it possible to do? Small example: df <- data.frame(cat=LETTERS[1:4],num=rnorm(4)) ggplot(df, aes(x=cat, y=num)) + geom_point() +
2009 Jul 23
1
ggplot2 : commands on one line vs two lines.
I have just started using ggplot2 and I seem to be doing something stupid in writing ggplot2 commands on more than one line. In the example below the commands on one line are working fine, but as soon as I put them on two lines I get an error. Can any one point out what I am doing wrong? It must be something blindingly simple. Thanks Example
2017 Dec 04
0
YNT: ggtern and bquote...
reading ?plotmath you might notice that "_" isn't the propper syntax for subscripts. This will work: ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend = c(.30,.50,.0),zend =c(.0,.50,0.3)))+ geom_point()+ theme_showarrows()+geom_segment(size=.5)+ geom_text_viewport(x=c(.45,.27,.37),y=c(.32,.29,.22),label=c("P[a]","P[b]","P[c]"), parse=TRUE)
2017 Dec 04
1
ggtern and bquote...
D'oh! Thanks for pointing this out. I blame caffeine depletion at the time... -pd > On 4 Dec 2017, at 15:48 , Eik Vettorazzi <E.Vettorazzi at uke.de> wrote: > > reading ?plotmath you might notice that "_" isn't the propper syntax for > subscripts. This will work: > > ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend = > c(.30,.50,.0),zend
2009 Nov 17
2
Lattice plot
Hi, I was trying to get a graph in lattice with the following data frame (7 rows, 5 cols): chr start1 end1 meth positive 1 1 10 20 1.5 y 2 2 12 18 -0.7 n 3 3 22 34 2.0 y 4 1 35 70 3.0 y 5 1 120 140 -1.3 n 6 1 180 190 0.2 y 7 2 220 300 0.4 y I wanted the panels to be organized by 'chr' -
2011 Dec 14
0
hclust and ggplot2
I saw an example online of taking hclust dendrogram and plotting it using ggplot2 and thought I would give it a try to see what it would look like. I get an error when trying to use ggplot; Error: ggplot2 doesn't know how to deal with data of class phylo. Regular plot works fine but I can't get ggplot2 to work. see code below.... rows=100 columns=100 #create matrix
2017 Dec 04
1
YNT: ggtern and bquote...
Hi, My example code is this; x11<-data.frame(A=c(.6,.6,.6),B=c(.20,.20,.20),C=c(0.20,.20,.20)) ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend = c(.30,.50,.0),zend =c(.0,.50,0.3)))+ geom_point()+ theme_showarrows()+geom_segment(size=.5)+ geom_text_viewport(x=c(.45,.27,.37),y=c(.32,.29,.22),label=as.expression("P_a","P_b","P_c"))
2012 Feb 29
1
ggplot2 dot chart-start at zero
I am trying to create a simple dot-plot in ggplot2 with a solid line from the y-axis to the dot, something I first saw in Cleveland's 1984 book What I would like is to have the graph start at zero on the x-axis but leave some space on the right side of the plot area. I assumed that I should be able to do this with expand() in scale_x_continuous() but either I'm wrong or just don't
2014 Jun 20
1
zuzufarah Help with ggplot 2 error: Aesthetics must either be length one, or the same length as the dataProblems
WUA_table<-WUA.df[,2:dim(WUA.df)[2]] WUA_discharge<-WUA.df[,1] colour_scheme<-palette(rainbow(dim(WUA_table)[2])) # Main scatterplot p1 <- ggplot(NULL, aes(WUA_discharge,WUA_table)) + geom_line() + scale_color_manual(values=colour_scheme)+ scale_x_continuous(expand = c(0, 0)) + scale_y_continuous(expand = c(0, 0)) + expand_limits(y = c(min(WUA_table) -
2011 Nov 16
1
geom_bar with missing data in package ggplot
Dear all, I was hoping someone could help with a ggplot question. I would like to generate a faceted bar chart, but missing data are causing problems. g<-structure(list(Date = structure(c(11322, 11687, 12052, 11322, 11687, 12052, 11322, 11687, 12052, 11322, 11687, 12052), class = "Date"), variable = c("Govt Revenues to GDP", "Govt Revenues to GDP",
2013 Jan 24
1
Insert segment only on particular facets in ggplot
Dear R users, I am working on a data-set with 3 species. They are apple, orange and banana. I want to annotate the facets only on the bottom panel. However, by default I am getting annotations on all the plots. I was able to get text annotation only on the desired plot. However, I am confused what I need to do for the arrows / segments. Here is my code: library(ggplot2) library(grid) tempobs
2008 Oct 05
0
ggplot2 - version 0.7
ggplot2 ------------------------------------------------------------ ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and avoid bad parts. It takes care of many of the fiddly details that make plotting a hassle (like drawing legends) as well as providing a powerful model of graphics that makes it easy to produce
2008 Oct 05
0
ggplot2 - version 0.7
ggplot2 ------------------------------------------------------------ ggplot2 is a plotting system for R, based on the grammar of graphics, which tries to take the good parts of base and lattice graphics and avoid bad parts. It takes care of many of the fiddly details that make plotting a hassle (like drawing legends) as well as providing a powerful model of graphics that makes it easy to produce
2024 Jan 11
4
arrow on contour line
Hello, I am drawing contour lines for a function of 2 variables at one level of the value of the function and want to include a small arrow in any direction of increase of the function. Is there some way to do that? Below is an example that creates the contour lines. How do I add one small arrow on each line in the direction of increase of the function (at some central point of the contour
2012 Nov 22
1
ggplot2 and the legend
Dear all, i try to plot with ggplot2. Therefor I have an matrix with 3 colums. With cbind I add an additional column called "col". I need this column "col" because in a later step and want to specify here some plot details which I will get from another analysis If I want to plot with this code, I have the problem that the legend is wrong. Blue changed to green and green to
2011 May 28
1
How to do operations on zoo/xts objects with Monthly and Daily periodicities
Is there an elegant way to do operations (+/-/*/ / ) on zoo/xts objects when one serie is monthly (end of month) and the other daily (weekdays only) - typically a monthly economic indicator and a stock index price? Thanks, TDB -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-operations-on-zoo-xts-objects-with-Monthly-and-Daily-periodicities-tp3558081p3558081.html
2012 Apr 12
1
Could dynlm function work for xts objects?
It seems to only works for zoo or ts objects? I tried to run it for xts objects, and error message occurs. Once I coerce it to be an zoo object (by as.zoo), it works. Error message: Error in model.frame.default(formula = dynformula(PIh - PI ~ L(X, 0:i) + : variable lengths differ (found for 'L(X, 0:i)') In addition: Warning messages: 1: In zoo(coredata(x), order.by = index(x), ...)