Displaying 20 results from an estimated 800 matches similar to: "ggplot2: scale_y_log10() with geom_histogram"
2009 Jul 21
1
geom_histogram help
Hi,
I have a histogram.But I need seperate colours for fixed range of values.for
eg. between 2-3 on the x axis a colour.3-4 another colour etc. and the
legend has to say what each colour is.How can this be done in
geom_histogram?
--
Rajesh.J
[[alternative HTML version deleted]]
2009 Jul 20
3
Histograms on a log scale
Dear All,
I would like to be able to plot histograms/densities on a semi-log or
log-log scale.
I found several suggestions online
http://tolstoy.newcastle.edu.au/R/help/05/09/12044.html
https://stat.ethz.ch/pipermail/r-help/2002-June/022295.html
http://www.harding.edu/fmccown/R/#histograms
Now, consider the code snippet taken from
http://www.harding.edu/fmccown/R/#histograms
# Get a random
2003 Jul 22
4
greek in main title
Hello,
I have written a function that demonstrates the CLT by
generating samples following the exponential distribution,
calculating the means, plotting the histogram, and drawing
the limiting normal curve as an overlay. I have the title
of each histogram state the sample size and rate (1/theta)
for the exponential (the output is actually 4 histograms),
but I can't get the greek letter theta
2002 Feb 17
5
Horizontal Boxplot
Hello all.
I'm just a beginner trying to draw a boxplot and I don't know why every time
I try to make it horizontal I receive the error message "parameter
'horizontal' couldn't be set in high-level plot() function". Can anybody give
me an advice?
Here is the code:
opar <- par(ask = interactive() && (.Device == "X11" || .Device ==
2007 May 12
2
Implicit vs explicit printing and the call stack
Hi everyone,
I've run into a bit of strange problem with implicit vs explicit
printing and the call stack. I've included an example at the bottom of
this email. The basic problem is that I have an S3 object with a
print method. When the object is implicitly printed (ie. typed
directly into the console) the function arguments in the call stack
are exploded out to their actual values,
2017 Nov 02
3
ggplot inside function doesn't plot
I have a function:
myplot <- function (X) {
d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE)
png(paste("img/", X, ".png", sep=""))
ggplot(d, aes(x=condition, y=count, color=condition)) +
geom_point(position=position_jitter(w=0.1,h=0)) +
scale_y_log10(breaks=c(25,100,400)) +
ggtitle(X) +
2007 Jul 24
1
ggplot2 axis color
Hi:
Does anyone have an idea on how to color the axis and
labels using ggplot2? This is what I got:
library(ggplot2)
p <- qplot(total_bill, tip, data = tips)
NewPlot<- p + geom_abline(slope=c(0.1,0.15,0.2),
colour=c("red","blue","yellow"),size=c(2,5,2))
NewPlot + geom_smooth(colour="green",
size=3,linetype=3)
2017 Nov 02
3
ggplot inside function doesn't plot
I don't really understand. I mean, I understand the solution is
print(ggplot(...)). But why is that required in a function and not at
the console?
Shouldn't I be able to rely on what I do at the console working in a
script? Is this inconsistent behavior by design?
On Thu, Nov 2, 2017 at 11:54 AM, David Winsemius <dwinsemius at comcast.net> wrote:
>
>> On Nov 2, 2017,
2017 Nov 02
0
ggplot inside function doesn't plot
> On Nov 2, 2017, at 9:27 AM, Ed Siefker <ebs15242 at gmail.com> wrote:
>
> I have a function:
>
> myplot <- function (X) {
> d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE)
> png(paste("img/", X, ".png", sep=""))
> ggplot(d, aes(x=condition, y=count, color=condition)) +
>
2001 Feb 04
1
Linux shared library problem (PR#838)
Full_Name: Daniel Egloff
Version: 1.2.1
OS: Linux Redhat 7.0
Submission from: (NULL) (212.35.34.200)
Externals in the shared library libc.so.6 not found. See the
following R session, with the abort message at the end.
> demo(graphics)
demo(graphics)
---- ~~~~~~~~
Type <Return> to start :
> opar <- par(ask = interactive() && (.Device %in%
2017 Nov 29
3
Removing a data subset
Say I have a dataset that looks like
Location Year GW_Elv
MW01 1999 546.63
MW02 1999 474.21
MW03 1999 471.94
MW04 1999 466.80
MW01 2000 545.90
MW02 2000 546.10
The whole dataset is at http://doylesdartden.com/ExampleData.csv
and I use the code below to do the graph but I want to do it without MW01.
How can I
2010 May 10
1
ggplot: Trouble with xlim() and discrete scales
I'm learning ggplot and am a little confused. Sometimes discrete scales work
like I'd expect, and sometimes they don't. For example...
This works exactly like one would expect:
df<-data.frame(names=c("Bob","Mary","Joe","Bob","Bob"))
ggplot(df,aes(names))+geom_histogram()
But this yields an error:
2008 Apr 17
2
pnbinom.c qnorm.c
Dear R users,
I was wondering from where I could get the C source code to compute
pnbinom() and qnorm() ?
(I would use R in batch mode but I find the startup time prohibitive, unless
there is a way to speed it up)
I searched the Web and it clearly is part of the R distribution, I just
don't know how to extract them.
Thanking you !
Markus Loecher
Princeton, NJ
[[alternative HTML version
2010 Jan 12
2
Placing eps files from R into Adobe InDesign documents: specifying fontfamily
This is a solution I am posting for a problem that others may have.
If you want to:
1. Place lattice graphics from R into an Adobe InDesign document, and
2. Use the export as eps function in R to maximize resolution (it is much
better than exporting as a metafile or bitmap), and
3. Use long strings of text in your titles or captions or to label your
axes.
Then you will have problems because:
2023 Aug 02
2
Choosing colours for lines in ggplot2
Hello - I am trying to plot flows in a number of rivers within the same
plot, and need to colour the lines differently, using a colour-blind
palette.
Code beneath works but has colours assigned by the program I have made some
simple dummy data:
## code 1
cb8<- c("#000000", "#E69F00", "#56B4E9", "#009E73","#F0E442", "#0072B2",
2009 Apr 25
2
Changing gird marks in ggplot2
Hi,
When I zoom into a graph created in ggplot2 with the
coord_cartesian(ylim=c(0,5)) option, I have no values labelled on my y-axis.
For this graph ggplot2 only puts labels the y-axis at intervals of 10 (i.e.
0, 10, 20, ...). However, the major portion of the graph I am interested in
is located between the values of 0 and 5 on the y-axis (thus why I am
zoooming). How can I coerce ggplot2 into
2004 Dec 03
1
How to wrap or split labels on plot
Dear R gurus,
I want to wrap labels that are too long for a plot. I have looked at
strsplit(), substr(), nchar(), and strwrap(). I think it's some
combination but I'm having difficulty trying to figure out the right
combo. I think I need to create some new matrix containing the labels
already split, though I'm not sure if maybe there is a quick and dirty
way to address this
2011 Jun 07
1
ggplot2 Histogram with density curve
I am learning ggplot2 commands and I have figured out how to create
histograms and density curves but I am not sure how to add a density curve
on top of a histogram.
Here are the two graphs that I created.
## Histogram
t<-rnorm(500)
w<-qplot(t, main="Normal Random Sample", fill=I("blue"), colour=I("black"),
geom="histogram")
w
##Density Curve
2008 Nov 12
2
apply() just loops ?
Dear R users,
I have been diligently using the apply() family in order to avoid explicit
for loops and speed up computation.
However, when I finally inspected the source code for apply, it appears that
the core computation is a simple loop as well.
What am I missing ? Why the often found advice to use apply() instead of
loops and the actually observed empirical speedups on many tasks ?
Thanks in
2010 Mar 09
2
MASS package not on CRAN ?
The MASS package is listed on the CRAN web site (
http://cran.r-project.org/web/packages/MASS/index.html) but I am unable to
install it via install.packages(). The error is that the package is
"unavailable". When I manually download the source tar ball and try to
install it on a Linux machine, installation fails because "it is not a valid
package".
Do I need to search