Displaying 20 results from an estimated 4000 matches similar to: "R Stacked Histogram"
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
2008 May 19
2
Histograms without bars
Hello
I'd like to plot a histogram of some data composed of real numbers. The
bin width I'm using is ~ 0.01, which results in high values in the y
axis, so that the area under each bar corresponds to the probability of
the data in that range.
Is is possible to plot points whose y coordinate correspond to that
probability, instead of plotting the histogram bars? In other words,
instead of
2009 Jan 29
2
Adding vertical line to histogram and qplot "stacked" plot
R-users it appears I am leaning on your knowledge once again. Is there any way to add a vertical line to a histogram and qplot "stacked" plot? Here is my current attempt:
"qplot" approach attempt:
qplot(Run, data = data_dataframe, breaks = breaks, fill = Temperature, main = short_title) + scale_x_continuous("Data") + scale_y_continuous("Freq")
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
2010 May 21
2
multiple qplot histograms in one plot
Hi,
I wish to plot multiple histograms(representing different data so different
range along xaxis but y axis is the same) horizontally in ggplot2. I'd like
it to look like facets. Is this possible?
--
Rajesh.J
[[alternative HTML version deleted]]
2009 Sep 06
5
ggplot2::qplot() -- arbitary transformations of coordinate system?
Hi,
Does anyone know how to do a coord_trans() in which the y-axis is
tranformed into (for example) -1000/y?
Thanks,
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
Parcels: Room 102 Gilmer Hall
McCormick Road Charlottesville, VA 22903
Office: B011
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
2011 Jan 14
2
bug in qplot (library ggplot2)
Hello,
this following code give a nice png:
/library(ggplot2)
i <- 1
png(file=paste('test ',i,'.png',sep=''))
qplot(carat, data=diamonds,
fill=color,geom='histogram')+scale_y_continuous(i)
dev.off()
/
I would like to get more files, but the following code doesn't make any
file:
/library(ggplot2)
for (i in 1:2) {
png(file=paste('test
2011 Jun 01
1
Plotting from functions
I can plot to png's fine when i run this directly from the top-level
script/console:
png('diamonds.png');qplot(carat,price,data=diamonds);dev.off()
But for some reason it's not working when that's in a function:
(function(){png('diamonds.png');qplot(carat,price,data=diamonds);dev.off()})()
I suspect this is because the qplot's return value must be
2011 May 26
1
Question about ggplot2
Hi all,
Is there any way for me to to string in the argument of qplot or ggplot? for
example
qplot(x='carat',y='price',data=diamonds,geom=c('point','smooth'))
instead of
qplot(x=carat,y=price,data=diamonds,geom=c('point','smooth'))
Thanks!!
Regards,
TszKin Julian
[[alternative HTML version deleted]]
2009 Jan 30
1
Using ggplot2 I need to move the location of legend to on the plot
Thanks again for the hints about adding the vertical line to the hist plot and in ggplot. That worked great.
Based on that advice I've been flipping through the ggplot2 doc and ggplot-static\index.html webpage more looking for the answer to the next question.
Unfortunately, I haven't stumbled on a description of how to move around the location of the legend.
Here is what I
2009 Aug 04
5
Stacked plots with common x-axis and different y-axis
Is there a place that shows how to create two plots that are stacked on top of each other where they share a common x-axis scale, but have differnt y-axis scale?
Say have the following data: airquality
Stack plot(airquality$Day, airquality$Wind) on top of plot(airquality$Day, airquality$Temp).
I am interested in stacking the two on top of each other with no seam, or plotting the two lines with
2009 Jan 27
1
3-axis Barplots (plus qplot like staked histogram capability)
Searched my R reference docs*, and the Rseek, but evidently I've overlooked this capabilty.
Is it possible to produce a 3d Barplot using R?
For example would like to have a three axis bar plot - \
x-axis = location(discrete),
y-axis = data value,
z-axis = frequency of value occurance (of location and value)
Would also if could also do something like what "qplot" allows,
2009 Feb 02
1
Broke ggplot...
It appears I broke ggplot in my script, but that maybe it is because the caffeine has worn off or maybe it is late in the day. I thought I was beginning to understand ggplot, but I have encountered a silly little issue.
For some reason the following does not produce a histogram with fill due to the Person's characteristics:
(Note that VADeaths_flat_df$Data works fine...)
2011 Sep 30
2
ggplot2 - extracting values of smooth
Suppose that I'm working on Hadley's diamond dataset and I want to
review the relationship between price, colour and carat.
I might run the following:
library(ggplot2)
#plot scatter and add some hex binning
q<-qplot(carat,price,data=diamonds, geom=c("hex"),
main="Variability of Diamond Prices by Carat and Colour")
#facet to get one scatter for
2008 Oct 28
1
does qplot works with Sweave?
Hi Hadley:
I'm practicing writing a document using MikTex but can't make qplot to execute. It works when using 'plot' though. Is this a normal behaviour?
\documentclass[9pt]{article}
\title{ggplot2 example}
\begin{document}
\maketitle
\section*{Examples of using ggplot2}
The goal is to be able to import ggplot2 graphics into the annual report.
Hadley Wickham has done a great
2009 Jan 28
1
Changing histogram stack in qplot
I've been using qplot pretty successfully to generate stacked histograms. However, it appears that I need to tweak the colors a little.
I've got three temperature variables (characters not numeric) and I need to change from the default qplot colors to the following:
Low = Blue
Middle = black
High = Red
Here is pseudo code of what I have currently:qplot(Run, data = TestData, breaks =
2007 Jun 14
1
back-transform predictors for x-axis in plot -- mgcv package
My question is related to plot( ) in the mgcv package. Before modelling
the data, a few predictors were transformed to normalize them.
Therefore, the x-axes in the plots show transformed predictor values.
How do I back-transform the predictors so that the plots are easier to
interpret?
Thanks in advance,
Suzan
--
Suzan Pool
Oregon State University
Cooperative Institute for Marine
2012 Aug 07
1
Styling gridExtra's title and left labels
Hi,
I'm using the gridExtra package to combine some graphs like in the
arrangeGrob example. Each of the graphs has a title but they appear much
larger than the overall combined plot title and left axis label. Does anyone
know how I can control the style / size of the gridExtra labels?
library(gridExtra)
library(ggplot2)
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
p1 <-