Displaying 16 results from an estimated 16 matches for "geom_rect".
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
represent the duration of the cycle (in months). In other words, all
rectangles h...
2013 May 18
3
bar plot with non-zero starting level
Hi,
I want to plot grouped bars to compare 95% confidence interval estimates
from two models. Each bar represents a 95% confidence interval estimate
of a coefficient from one of the two models. Each group represents
confidence interval estimates of the same coefficient from the two models.
I think such a bar plot will nicely present whether 95% confidence
interval estimates of the same
2013 Mar 22
4
ggplot2 will not draw a rectangle. Error: ggplot2 doesn't know how to deal with data of class XXX"
...L, 244158L, 243971L, 249932L, 254622L, 263114L, 274370L,
282955L, 282352L, 278092L)), .Names = c("year", "federal.ps"),
class = "data.frame", row.names = c(NA, -13L))
p <- ggplot(fcs, aes(year, federal.ps )) + geom_line()
p + geom_rect(data=rect, aes(xmin=xmin, xmax = xmax, ymin=-Inf, ymax = Inf),
fill='red', alpha=0.2)
##=============End Code==========================
sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: i686-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C...
2013 Mar 15
0
ggplot2, arrows and polar coordinates
...---------------------------------------------
# Example adapted from the help page of "geom_segment"
library(ggplot2)
library(grid)
d <- data.frame(x1=-135.3, x2=-158.3, y1=37.2, y2=45.2)
p <- ggplot(seals, aes(x = long, y = lat))
p1 <-
ggplot() +
coord_cartesian() +
geom_rect(data=d, mapping=aes(xmin=x1, xmax=x2, ymin=y1, ymax=y2),
fill="red", color="red", alpha=0.5) +
geom_segment(data=seals, aes(x = long, y = lat, xend = long +
delta_long, yend = lat + delta_lat), arrow = arrow(length = unit(0.2,"cm")))
p2 <-
ggplot() +
coo...
2008 Nov 04
2
ggplot & annotating charts
...gplot (ie add text
to line charts, highlighted boxes etc). By and large, I can get close to
what i want with base graphics, but would ideally like to use ggplot
whenever possible (additionally, i would like to add text labels
automatically to the chart). The code is below
I suspect I need to use geom_rect, but what is foxing me is how to set up
the aes() parameters.
I'd be very grateful for any help
thanks
simeon
###################
require(zoo)
require(chron)
vix <-read.csv("
http://www.cboe.com/publish/ScheduledTask/MktData/datahouse/vixcurrent.csv",
header=T,s...
2013 May 14
1
Tamaño plots y calidad en grafico ggplot
...+
geom_hline(yintercept = seq(245, 305, 10), linetype=2, colour="#E1EBFF")+
geom_vline(xintercept = seq(1, 33, 2.5), linetype=1, colour="#E1EBFF")+
geom_vline(xintercept = -2, linetype=1, colour="white")+
geom_vline(xintercept = k, colour="#0000FF20", lwd=5)+
geom_rect(xmin=-2,xmax=-1, mapping=aes(NULL, NULL,
ymin=inicio[3:4],ymax=fin[3:4], fill=Niveles[3:4]),
alpha=1, data=niveles)+
geom_text(data=niveles, aes(x=-1.4,
y=inicio[3:4]+(fin[3:4]-inicio[3:4])/2, label=Niveles[3:4], size=2)) +
scale_x_discrete(labels=Jurisdiction)+
scale_y_continuous(breaks=seq(245,...
2012 Sep 15
2
qplot: plotting precipitation data
Dear list,
I wish to plot chromatin precipitation data: I would like to have a
rectangles (x:end-start, y:peak) but I do not have an idea how to define x
(in terms of qplot syntax) and to choose the correct geom.
mydata is a subset of a larger file.
> mydata
chrom start end peak
1 chr11 5291000 5291926 8
2 chr11 10988025 10988526 7
3 chr11 11767950 11768676 8
4
2012 Apr 05
1
issue with base:::namespaceImportMethods
...configurations. One example is the ggbio
package in Bioconductor, which currently emits these warnings when its
namespace is loaded:
----------------------
library(ggbio)
Loading required package: ggplot2
Attaching package: ‘ggbio’
The following object(s) are masked from ‘package:ggplot2’:
geom_rect, geom_segment, stat_identity, xlim
Warning messages:
1: found methods to import for function ‘append’ but not the generic itself
2: found methods to import for function ‘as.factor’ but not the generic
itself
3: found methods to import for function ‘as.list’ but not the generic
itself
4: found meth...
2010 Sep 03
6
how can I plot bar plots with all the bars (negative and positive) in the same direction????
Dear r-help mailing list,
this seems stupid, but I actually don't find the solution:
if I have a vector of numbers x of length n, ranging, say, from -3 to 4, if I do
barplot (x)
all the values below 0 go downwards, and all the positive values go upward. How can I make them all begin from the minimum pointing upwards?
Thanks!
Gabriele Zoppoli, MD
Ph.D. Fellow, Experimental and Clinical
2009 Dec 11
0
ggplot2: version 0.8.4
...fixes to full names
* aesthetics: corrected list of aesthetics to include american spelling of
colour as well as base R abbreviations
* aesthetics: fix bug in detecting which aesthetics are calculated
* aes_string treats NULL as "NULL"
* annotate now works with missing x and y (e.g. for geom_rect)
* continuous scale limits now automatically sorted
* coord_polar: fix bug if breaks not all inside limits
* facet_wrap: can now specify both ncol and nrow without getting an error
* facet_wrap: now works with statistics that produce both x and y values (e.g.
stat_qq)
* fullseq now adds additiona...
2009 Dec 11
0
ggplot2: version 0.8.4
...fixes to full names
* aesthetics: corrected list of aesthetics to include american spelling of
colour as well as base R abbreviations
* aesthetics: fix bug in detecting which aesthetics are calculated
* aes_string treats NULL as "NULL"
* annotate now works with missing x and y (e.g. for geom_rect)
* continuous scale limits now automatically sorted
* coord_polar: fix bug if breaks not all inside limits
* facet_wrap: can now specify both ncol and nrow without getting an error
* facet_wrap: now works with statistics that produce both x and y values (e.g.
stat_qq)
* fullseq now adds additiona...
2013 May 13
0
Tamaño plots y retoques de ticks en grafico ggplot
...+
geom_hline(yintercept = seq(245, 305, 10), linetype=2, colour="#E1EBFF")+
geom_vline(xintercept = seq(1, 26, 2.5), linetype=1, colour="#E1EBFF")+
geom_vline(xintercept = -2, linetype=1, colour="white")+
geom_vline(xintercept = k, colour="#0000FF20", lwd=5)+
geom_rect(xmin=-2,xmax=-1, mapping=aes(NULL, NULL,
ymin=inicio[3:4],ymax=fin[3:4], fill=Niveles[3:4]), alpha=1,
data=niveles)+ geom_text(data=niveles, aes(x=-1.4,
y=inicio[3:4]+(fin[3:4]-inicio[3:4])/2, label=Niveles[3:4], size=2)) +
scale_x_discrete(labels=tabla$Country)+
scale_y_continuous(breaks=seq(2...
2013 Oct 19
3
bold dot size and name in plot
Dear useRs,
I have the following data "z" of two variables "x"(z[,1]) and "y"(z[,2]).
> dput(z)
structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
2008 Nov 21
0
ggplot2 - version 0.8
...gsave now recognises the .svg extension and will produce svg files,
if possible
* ggsave: default dpi changed to 300, on the assumption that you are
saving the plot for printing
* qplot: uses facet_wrap if formula looks like ~ a + b (as opposed to a ~ b)
Aesthetic tweaks
* geom_bar, geom_polygon, geom_rect, ...: default fill colour is now
much closer to black to match the defaults in other geoms (point,
line, etc)
* geom_line, geom_path, geom_segment: lines have squared ends
* geom_point, geom_pointrange and geom_boxplot: now use shape = 16
instead of 19. This shape does not have a border from R 2.8...
2008 Nov 21
0
ggplot2 - version 0.8
...gsave now recognises the .svg extension and will produce svg files,
if possible
* ggsave: default dpi changed to 300, on the assumption that you are
saving the plot for printing
* qplot: uses facet_wrap if formula looks like ~ a + b (as opposed to a ~ b)
Aesthetic tweaks
* geom_bar, geom_polygon, geom_rect, ...: default fill colour is now
much closer to black to match the defaults in other geoms (point,
line, etc)
* geom_line, geom_path, geom_segment: lines have squared ends
* geom_point, geom_pointrange and geom_boxplot: now use shape = 16
instead of 19. This shape does not have a border from R 2.8...
2010 Jun 30
2
ggplot qplot bar removing bars when truncating scale
I'm having problems with this example, it is posted with reproduceable code
below, both with the normal 0-6 scale and the desired 3-6 scale (with bars
removed). How can I get the graph to have the desired 3-6 scale without
removing the bars. Thanks!
#Data