ggplot2 is an actively maintained open-source chart-drawing library for R, written by Hadley Wickham, based upon the principles of "Grammar of Graphics". It partially replaces R's basic plot and the lattice package, while providing a clean, powerful, orthogonal and fun API.
1
vote
2answers
41 views
calling `str` on a object errors out if the ggplot2 package is loaded
The following was tested with R 2.15.3, ggplot2 0.9.3.1 and gtable 0.1.2 on Debian squeeze.
In the course of debugging this ggplot2 issue
multiple calls to annotation_custom fail in certain cases, I ...
1
vote
1answer
43 views
ggplot2 does not appear to work when inside a function R
I'm a bit new to R - I've been trying to wrap an R script as a function so I can call it from Rserve. Does anyone know why ggplot2 would not work inside a function yet works just fine outside of it?
...
0
votes
1answer
27 views
ggplot2: Changing which values are annotated on the x-axis
My question is certainly a replicate but I can't find the answer.
On the x-axis the values that have a tick in my plot are: 2.5,5,7.5,10,12.5.
I want to modify which values have a tick in order to ...
2
votes
1answer
31 views
Labelling lines in ggplot2 with their gradients and changing legend characteristics
I am looking at the change in maximum temperature per month, from 1954-2000 using data thus:
http://pastebin.com/37zUkaA4
I have decided to only plot the abline for each month on the graph for ...
0
votes
0answers
23 views
Saving plot as .emf messes up axis labels in R
I have a simple ggplot code to plot some time series data:
ggplot(Averaged30mins, aes(x=Time, y=Insolation))+geom_point()+theme_bw()
+scale_x_continuous(breaks=c(seq(0,24,2)))+xlab("Local Apparent ...
1
vote
1answer
40 views
ggplot2: plotting non-contiguous time durations as a bar chart
I'm using ggplot to plot various events as a function of the date (x-axis) and start time (y-axis) on which they began. The data/code are as follows:
...
1
vote
1answer
18 views
ggplot + geom_point + legend based on both size and color
Is there a way to display both size and color in the legend when using geom_point?
cons2 <- data.table(
value_date = c(as.Date('2013-04-30'),as.Date('2013-04-30'),
...
1
vote
1answer
39 views
ggfluctuation in different color
I used ggfluctuation to plot a correlation matrix with missing values. the matrix range is from -1 to +1. the values are represented by the size of red square so missing values are plain gray.
I ...
3
votes
1answer
55 views
How to fit data with non linear function and plot data and fit with ggplot()
A measurement shows a signal that is formed like a square root function with offset and a factor. How can I find the coefficients and plot the raw data and the fitted curve in one plot?
...
1
vote
0answers
24 views
Using rpy2 with ggplot2 to make graphs
I'm trying to integrate some graph generation in my python pipeline by using rpy2. The same PDF generated inside of R, apparently doesn't work inside of rpy2. This simple script will make a readable ...
2
votes
1answer
40 views
ggplot2: How to get symbols to stay the same for factors in two different scatterplots?
This problem has been driving me crazy. I am trying to make scatterplots with two different datasets. My dataframe is
structure(list(x1 = c(5L, 3L, 4L, 5L, 4L, 8L, 5L, 6L, 3L, 4L,
5L, 6L, 8L, 4L), ...
4
votes
0answers
61 views
Plotting normal distributions
I am trying to plot 3 examples of the normal distribution, however ggplot appears to be recognising the path as one continuous one rather than one stratified by the factor levels. I am relatively new ...
0
votes
1answer
32 views
plot multiple cumulative percentage graph by groups
I have data looks like:
zip ID count
230 B 12
230 A 10
230 C 9
230 D 5
270 C 10
270 A 9
270 B 8
290 C 9
290 A 8
290 B ...
0
votes
1answer
35 views
multicolored background, values offset from gridline
I want to use R to produce a graph that looks like this:
https://dl.dropboxusercontent.com/u/9297902/R_desired_output.png
The scale runs from 0 on the left to 100 on the right, with each major ...
0
votes
1answer
29 views
How to added a custom legend for geom_hline
Using the data below, notice the legend does not probably describe geom_hline:
df<-data.frame(
points=c(.153,.144,.126,.035, .037, .039, .010,.015,.07),
...