Displaying 20 results from an estimated 2000 matches similar to: "format y-axis values in ggplot"
2012 Jan 03
4
Changing X axis of ggplot
Thanks to Joshua Wiley for turning me on to ggplot2.
I am making a plot using this:
p <- ggplot(dallas, aes(x = offense_hour)) + geom_bar() + coord_polar()
Dallas is a data frame, and offense_hour is a column with chron
objects from the chron library. In this case, the chron object was
created with the times function. It is only a time (H:M:S) with no
date attached.
The plot shows up fine,
2008 Jun 04
1
ggplot questions
Hello,
A few questions about the following examples:
1. Why do the two plotting versions not produce the same result?
2. Is the 'scale_x_continuous' (or *_y_* or *_*_discrete) geom the best
way to setup grids (as in visual guide-lines) in polar (or for that
matter, any) coordinate system?
3. Why do these commands appear to generate 3 plot pages each?
4. Perhaps more questions to follow
2008 Apr 04
1
How to access the attributes of a ggplot?
Hi,
I am having some hard time figuring how to access (and modify) the
properties of an object created by ggplot.
I found 'ggopts', but it only returns some of the properties. Say I
want to get the x- and y-axis limits, the tickmark locations, legend
current position, the legend box and background color and set them to
new values.
Are these properties easily accessible (and modifiable)
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
2008 Oct 05
0
ggplot2 - version 0.7
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 Oct 05
0
ggplot2 - version 0.7
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 Jun 17
1
ggplot facet spacing, wrapping
I'm running into some problems with the spacing of some faceted ggplot plots.
I have a number of time series faceted to be one above another, but the
scale labels of the y axes all clobber each other at the bottom/top of each.
for example, try:
qplot(x, y, data = data.frame(x = 1:10, y = 1:10, size = 1:10), facets =
size ~ ., size = size) + scale_x_continuous(breaks = 1:10) +
2009 Jan 22
1
ggplot seq
Hi Hadley: Not sure if you received my email, so I am resending it again.
I have dealt with this before and I can't remember how it got resolved. It is too much data to reproduce the example below(49.000 records) but all I am after is trying to get the x axis breaks. I want my x axis to go from 27 to 51 and 1 to 25 by 2. I am trying to concatenate the breaks but it sorts the seq() in ascending
2013 Jan 24
1
Insert segment only on particular facets in ggplot
Dear R users,
I am working on a data-set with 3 species. They are apple, orange and
banana.
I want to annotate the facets only on the bottom panel. However, by default
I am getting annotations on all the plots. I was able to get text
annotation only on the desired plot. However, I am confused what I need to
do for the arrows / segments.
Here is my code:
library(ggplot2)
library(grid)
tempobs
2012 Jan 16
1
ggplot- using geom_point and geom_line at the same time
Hi
I am plotting line chart using ggplot and want to use geom_line and
geom_point simultaneously.
I get the plot but now I have two legends. None of the legend is
representing the true values. I need the legend with shape and color both.
Thanks
> con = textConnection("inputs var1 var2 var3+ 100 10 5 2+ 1000 20 10 4+ 5000 30 15 8+ 10000 40 20 16+ 30000 50 25 32")> data =
2007 Nov 13
1
ggplot2: changing axis labels in ggplot()
Hi all,
For various reasons, I need to use ggplot instead of qplot for a complex
figure. Everything is working fine, except I cannot figure out how to rename
the axis labels in ggplot. I have pasted a simple example below. Any ideas
on what I am doing wrong?
Thanks for your help.
James
library(ggplot2)
##create data
2008 Jul 22
1
scatter plot using ggplot
I used ggplot to create a scatter plot :
library(ggplot)
library(mnormt)
Sigma = matrix(c(1, 0.6, 0.6, 1), 2, 2)
x = rmnorm(20, c(0,0), Sigma)
xx = x[order(x[,1]),]
y = xx[,1]
z = xx[,2]
qplot(z, y, type="point", main="x-y plot", xlab="x", col="blue")
However I want following:
1. Plot color must be Blue (where it is displaying as red)
2. There should not
2013 Jan 08
1
ggplot not showing all the years on the x-axis
Dear R helpers,
I am currently having hard time fixing the values on the x-axis of a plot
with ggplot: even though I have 12 years, ggplot plots only 3 of them.
Here is my example:
library(ggplot2)
ii <- 2000:2011
ss <- rnorm(12,0,1)
pm <- data.frame(ii,ss)
tmpplot <- ggplot(pm, aes(x = ii, y = ss))
plot <- tmpplot + geom_line()
plot
In my case, ggplot reports on the year 2000,
2009 Apr 10
1
png with ggplot on windows xp
Hi Group,
I posted this question on the ggplot list and was advised to try here
also. The code
below produces a plot as a png and pdf. The pdf looks great, and I cannot
make the png look this way. I've tried various combinations of
height, width, and dpi, but it has not worked out so
far. Any suggestions to make the png look like the pdf? I received a
response that
the problem does not occur
2009 Sep 14
1
ggplot, ribbon not showing up properly
Hi,
I'm trying to plot a longitudinal data set, using ggplot and adding some
summary info (eg. mean, 1 sd bounds) using geom=ribbon. The summary
info is based on a subset of the original data (eg. less an outlier).
But I'm having trouble getting the ribbons to show up correctly. It's
probably something obvious that I'm missing as a novice at ggplot2, and
any help is much
2003 Mar 12
3
png plots
I saw in the archive a post from Mark Wilkinson (Feb 1, 2003), saying
that some of his R-generated png plots came out overlapping.
I am seeing the same thing (with R 1.6.2 on Linux i686). My input
file generated 4 plot files. The first two were fine, but the last 2
featured a weird overlay of the remaining graphs. The problem is not
seen with postscript of pdf output.
--
Allin Cottrell
2009 Apr 21
0
ggplot2 version 0.8.3
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 21
0
ggplot2 version 0.8.3
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
2010 Jan 18
3
add spline to longitudinal data - preferably similar to SAS's 'I=SM50S' routine
Hi Ruser
I'm trying to replicate some SAS code. I have to add a spline to my
longitudinal spaghetti plot.
I have the plot, but I can't add the spline, a overall trend line. In
the SAS code they use the command 'I=SM50S' and I would prefer
something similar. I?m using R 2.10.1 on windows XP?
I have made this working example.
tolerance.pp <-