Displaying 20 results from an estimated 3000 matches similar to: "ggplot2 : bug in coord_equal() ?"
2008 Jan 11
1
ggplot2, coord_equal and aspect ratio
Hi everyone, Hi Hadley,
I am a heavy user of coord_equal() in ggplot2 since most of my data is
spatial, on x,y coordinates. Everything works. However by enforcing an
aspect ratio of 1 for the plotting region, coord_equal() usually
wastes a lot of space if the region of interest is not a perfect square.
For example:
x=runif(10)
a=data.frame(x=x*3,y=x)
ggplot(data=a, aes(x=x,y=y)) +
2009 May 19
2
Coord_equal in ggplot2
Dear all,
I'm plotting some points on a graph where both axes need to have the
same scale. See the example below. Coord_equal does that trick but in
this case it wastes a lot of space on the y-axis. Setting the limits of
the y-axis myself was no avail.
Any suggestions to solve this problem?
library(ggplot2)
ds <- data.frame(x = runif(1000, min = 0, max = 300000), y = runif(1000,
min =
2012 Aug 10
1
ggplot2 geom_bar produces white slashes in legend keys
When I am using geom_bar I get these white slashes through the legend keys. I cannot figure out how to remove them.
ggplot(diamonds, aes(clarity, fill=cut)) + geom_bar()
I have tried using opts(legend.key = theme_blank()) but with no luck.
Any suggestions would be much appreciated.
I am using R vers. 2.15.0 and ggplot 0.9.1, win xp
Best wishes
Jonas Hal
2013 Apr 30
1
Stacked geom_bar with aggregated SE -ggplot2
Hi there,?
I've been battling with an extension of this in my own data: getting
appropriate error bars once data is stacked in a bar graph.?
(original question:
http://r.789695.n4.nabble.com/ggplot2-se-variable-in-geom-errorbar-s-limits-
td3311176.html). It wouldn't let me reply to that thread.
A modification of the earlier answer:?
data(diamonds)?
?diamonds_df <- ddply(diamonds,
2012 Mar 12
1
Faceted bar plot shows wrong counts (ggplot2)
I have encountered a problem with faceted bar plots. I have tried to
create something like the example explained in the ggplot2 book (see pp.
126-128):
library(ggplot2)
mpg4 <- subset(mpg, manufacturer %in%
c("audi", "volkswagen", "jeep"))
mpg4$manufacturer <- as.character(mpg4$manufacturer)
mpg4$model <- as.character(mpg4$model)
base <-
2010 Sep 10
3
ggplot bar geom: control the filling in the colour legend
Hi all,
Is it possible to change the filling of the squares used to represent
the colour legend in a bar plot with ggplot?
in this example, fillings are raven black, I'd like them white.
ggplot(diamonds, aes(clarity, colour = cut)) + geom_bar()
Regards
--
-------------
Benoit Boulinguiez
Ph.D student
Ecole de Chimie de Rennes (ENSCR) Bureau 1.20
Equipe CIP UMR CNRS 6226 "Sciences
2009 Sep 11
1
bar chart with means - using ggplot
Like this?
# example using qplot
library(ggplot2)
meanprice <- tapply(diamonds$price, diamonds$cut, mean);meanprice
cut <- factor(levels(diamonds$cut), levels = levels(diamonds$cut))
qplot(cut, meanprice, geom="bar", stat="identity", fill = I("grey50"))
dev.new() # create a new graph to compare with qplot
# Example using ggplot
ggdata <-
2009 Feb 02
1
Specifying the gap between "dodge'd" bins groups?
I'm looking at ggplot-static\position_dodge.html
For ggplot(diamonds, aes(x=price, fill=cut)) + geom_bar(position="dodge") , is it possible to specify the spacing between the dodge'd bin groupings?
That is, I would like for there to be a small separation (horizontal space) between the "Ideal" and the "Fair" bars on the plot. That way the reader can get
2012 Jan 29
1
ColorBrewer question
Hello, R friends,
I'm trying to change colors of my horizontal bars so that they show a sequence.
I chose the ColorBrewer palette "Blues". However the resulting plot doesn't show any changes to the default.
I tried several places of "+ scale_colour_brewer(type="seq", pal = "Blues")" with no effect.
This is my code:
p <- ggplot(data, aes(x =
2009 Jan 09
5
grep : escape "*"
Dear R useRs,
Sorry for this foolish question, but I can't find how to escape the *
character when using grep :
> grep("-", c("/3", "2*3", "4-4"))
[1] 3
> grep("/", c("/3", "2*3", "4-4"))
[1] 1
> grep("*", c("/3", "2*3", "4-4"))
Erreur dans grep("*",
2008 Nov 20
1
Problem with ggplot2
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20081120/1faae4b9/attachment.pl>
2006 Oct 13
3
Barplot legend position
Dear useRs,
I'm trying to create a barplot like so:
x=matrix(1:10,2,5)
barplot(x,leg=c("left","right"),besid=T)
The legend is placed in default position topright, however the data are
plotted there too. I tried controlling the legend position by adding
x="topleft" but this results in an error that x matches multiple formal
arguments.
Leaving out the legend
2009 Jan 30
2
error message with roxygen
Hello useRs,
I'm trying to use the Roxygen package.
Here my code file :
#' A packge to check Roxygen's sanity
#' @name helloRoxygen-package
#' @docType package
NA
And my R code to generate the package :
library(roxygen)
package.skeleton("helloRoxygen", code_files = "roxy.r", force = T)
roxygenize("helloRoxygen", "helloRoxygen",
2012 Feb 01
1
ggplot2(0.9.0): could not find function "=="
Hi,
I have a question related to the newest version of ggplot2 (0.9.0). I
just updated this morning and from CRAN it looks like the Mac version
is the only one at 0.9.0 as of right now.
http://cran.r-project.org/web/packages/ggplot2/index.html
Anyway, I was in the midst of a project where I was trying to
replicate "Back-to-back Bar Charts" in this blog post.
2008 Nov 22
2
ggplot2 - facet_grid and facet_wrap
Hello R users (and Hadley)
I have another question about ggplot2 :-)
(version 0.8)
`dat` <-
structure(list(D = c("a", "b", "c", "d"), G = c(1.51520888871520,
1.88812208268440, -6.60521862, 0.55968739), E = c(1.38888592256404,
1.39366168665589, 1.22509259382058, 1.36617701059296), I =
c(6.92634958902857,
6.94416045215158, 13.2179488828556,
2008 Mar 04
1
ggplot2 - Problem with grid plot
Hi R-help
I'm trying to create a grid plot in which each plot in the grid contains two
density plots (colored by factor) and two vertical lines at the respective
medians (also colored by the factor).
Using the diamonds dataset as an example, the following commands give me
price density plots by factor cut in a single, ungridded plot.
p <- ggplot(data=diamonds, aes(x=price)) +
2007 Sep 27
3
Plotting from different data sources on the same plot (with ggplot2)
Hello everyone (and Hadley in particular),
I often need to plot data from multiple datasets on the same graph. A
common example is when mapping some values: I want to plot the
underlying map and then add the points. I currently do it with base
graphics, by recording the maximum region in which my map+point will
fit, plotting both with these xlim and ylim parameters, adding par
(new=T)
2012 Jan 16
2
ggplot2 stacked bar - sum of values rather than count
Hi,
I'm trying to create a stacked bar plot using ggplot2. Rather than
plotting the count of each of the 13 "Bar" factors on the Y axis, I
would like to represent the sum of the Values associated with each of
the 13 "Bar" factors. Is there a way to do that? Given the following
data, that would obviously mean that there would be some negative sums
represented. Here's
2009 May 07
1
I updated/reinstalled ggplot2 and the trouble started...
Hi Ian,
Per your suggestion, I reinstalled R 2.9.0, then
I reinstalled ggplot2 on top. The problem persists.
Here's the what happens after the installation:
> qplot (carat, price, data = diamonds, alpha = I(1/10))
Warning message:
In grid.Call.graphics("L_points", x$x, x$y, x$pch, x$size) :
semi-transparency is not supported on this device: reported only once per
2009 Mar 02
3
ways to put multiple graphs on single page (using ggplot2)
Hi, Here are three plots:
library(ggplot2)
data(diamonds)
randind <- sample(nrow(diamonds),1000,replace=FALSE)
dsmall <- diamonds[randind,]
qplot(carat, data=dsmall, geom="histogram",binwidth=1)
qplot(carat, data=dsmall, geom="histogram",binwidth=.1)
qplot(carat, data=dsmall, geom="histogram",binwidth=.01)
What are ways to put these three plots on a single