Displaying 20 results from an estimated 50000 matches similar to: "Bin-width with wgplot()"
2010 Jul 29
2
ggplot2 histograms... a subtle error found
Hello all,
I have a peculiar and particular bug that I stumbled across with
ggplot2. I cannot seem to replicate it with anything other than my specific
data set.
Here is the problem:
- when I try to plot a histogram, allowing for ggplot2 to decide the
binwidths itself, I get the following error:
- stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to
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
2000 Jul 28
2
Loop removal?
Dear all,
I've got a quite large dataframe (stor) with rows subject and rt (reaction
time). I would like to split the reaction times per subject into 6 bins of
equal size. Right now, I'm using the following code:
bindata <- function(rt) {
bindata <- rep(-1,length(rt))
binwidth <- length(rt)/6
bindata[order(rt)[(0*binwidth)+1:(1*binwidth)]] <- 1
2008 Aug 06
1
grid layout scaling viewport width based solely on height
Hello all,
I'm trying to write a function that produces a main plotting region
with several square plots along the right side. Ideally the size of
right side plots will scale only with the height of the entire plot,
yet never overlap with another secondary plot. The following two
snippets get close, however, as I resize the plot horizontally the
right side plots (green squares) get smaller
2009 Aug 19
2
ggplot2 legend problem
I'm trying to overlay two histograms using transparency to enable viewing of
multiple distributions on a single scale. So far ggplot2 seems to do what I
want. However I'm having a problem generating the legend coloring
appropriate to each distribution in the plot.
Here is a test case to show my best (failed) effort so far:
library(ggplot2)
x <- data.frame(X=rnorm(1000, mean=0))
y
2010 Nov 30
2
ggplot2 histograms
Hi
With ggplot2 I can very easily create beautiful histograms but I would like to put two histograms on the same plot. The histograms may be over-lapping.
When they are overlapping the bars are shown on top of each other (so that the overall height is the sum of the two). Is there any way to get them to display overlapping (with smaller value in front, larger value behind) so that the overall
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...)
2008 Apr 04
0
ggplot2 - version 0.6
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 Apr 04
0
ggplot2 - version 0.6
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
2009 Apr 22
1
converting histogram to barchart
Hi list,
After a lot of tweaking i have managed to create a histogram with an
overlaying density plot. The histogram shows a sample of birth weights
of babies and the density plot shows birth weights from a much larger
reference populaton. My data is divided in 0.1 Kg bins so in the code
below binweigh=0.1.
The trouble with the current graph is that it is not very clear since
the density plot
2006 Nov 07
1
histogram bin width
hi all : i have the data below and then below that, i call the hist
function three times using the Scott method for the widths of the bins.
the bin width is different for the three histograms but I would like it
to always be 0.05 regfardless of the data
set being histogrammed.
I'm sure there must be a manual way to do this which is fine with me. i
tried breaks=0.05 but it wasn't happy
2009 Nov 14
2
formatting dates in axis labels (ggplot2)
I'm having trouble figuring out how to format Date variables when used
as axis labels in graphs.
The particular case here is an attempt to re-create Nightingale's
coxcomb graph with ggplot2,
where I'd like the months to be labeled as "Mar 1885", "Apr 1885", using
a date format
of "%b %Y" applied to label the dates, or really anything other than
2010 Feb 05
1
histogram scott
Dear all,
I want to use the histogtam as a density estimator, with the binwidths calculated using scott's formula which is
binwidth = 3.49*ST.dev.*n^(-1/3)
for the following data (30 data points)
12-9-3-6-1-23-21-7-18-16-15-4-19-22-20-2-3-18-8-10-1-7-5-4-11-12-3-9-19-7
so first,I' ve tried this manually, and substituted in the above formula and I got
st.dev.=7.02745
and thus the
2009 Nov 04
1
Patterned shading in ggplot
Am trying to produce a graph which prints out well in black and white using
ggplot2. I have the following example set up nicely, but want to shade the
red bars in one pattern and the blue in another so they print out clearly.
I tried changing colours to 1 light, 1 dark, but then the overlapping colour
looks virtually identical to the darker one. I noted the option density in
barplot, but
2007 Feb 12
1
Width of a plotting point (in inches) in grid package
Hello,
I'm trying to determine the width of a plotting point (in inches) in the
grid package. I naively thought I could create a pointsGrob with only one
point and get the width (as tried below), but this results in an object with
a size of 0inches (changing cex has no effect). Does anyone have a better
approach? Of course, it would be dependent upon the graphics parameters and
viewport...
2009 Dec 10
1
barplot and cumulative curve using ggplot2 layers
Hello
My dataset is as follows:
jobno recruits
1100 18
1200 1
1850 5
2100 190
2789 25
3000 1
. .
. .
the dataset has 130 rows
I want to plot barplot from left side and cumulative curve from right side
in one graph itself using layers in ggplot2.
I sorted the recruits 1st in decreasing order
2007 Oct 21
0
ggplot2 - version 0.5.6
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
complex multi-layered
2007 Oct 21
0
ggplot2 - version 0.5.6
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
complex multi-layered
2015 Jun 16
4
Ayuda boxplot ggplot2
Hola a todos
Me gustaría saber si me pueden ayudar con lo siguiente.
Realicé un Boxplot usando ggplot2 para visualizar el comportamiento de dos
variables. Visualmente no se notan las diferencias porque la gráfica de la
derecha (parásitos en el abdomen) llega hasta 20 en el eje y. ¿Cómo puedo
hacer para que las dos gráficas muestren la misma escala en el eje Y, es
decir, que las dos lleguen a 60?
2023 Jan 12
1
Reg: ggplot error
Hallo
I am not familiar with any of packages you use (except of MASS and ggplot2) and the code is too complicated without any hint where the error could come from and what is the message you get. I wonder if anybody would like to go through your whole code.
1. data seems to be read correctly
ICUData <- read.csv(file = "ICUData.csv", stringsAsFactors = TRUE)
ICUData.neuro <-