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.

learn more… | top users | synonyms (2)

-4
votes
0answers
14 views

Create a new plot with ggplot2 without deleting the old one

I'd like to know is there a way to create a new plot using ggplot2 without redrawing the old one, that I already have on screen.
1
vote
0answers
23 views

Create heatmap with distribution of attribute values in R (not density heatmap)

some of you might have seen Beyond "Soda, Pop, or Coke". I am facing a similar problem and would like to create a plot like that. In my case, I have a very large number of geo-coded observations (over ...
1
vote
2answers
34 views

Adding R^2 on graph with facets

I am plotting geom_points on multiple facets and would like to annotate R^2 on each facet (preferably on the facet_label rather on the graph.) I have found some code here which will give me the R^2 ...
0
votes
1answer
31 views

Overlaying many mutlple rectangular plots or area plots (facing limits on alpha aka transparency)

Ideally, I could find a way to do this with area plots, but the example will be with rectangles. The issue is that alpha does not seem to be doing it's job. There might be a completely different ...
0
votes
2answers
57 views

Why does this R ggplot2 code bring up a blank display device?

While SO is not usually used for help with bugs, this one shows particularly simple and particularly annoying behavior. If you are a ggplot2 user, you can reproduce it in 10 seconds or less. As this ...
0
votes
1answer
44 views

R - aggregate mean (generated in a loop) not appearing in graph

I have a few columns of data. I would like to find the mean for two different values for each time section by user. Then I would like to graph accordingly. There should only be one value for metricA ...
4
votes
1answer
46 views

ggplot2: Logistic Regression - plot probabilities and regression line

I have a data.frame containing a continuous predictor and a dichotomous response variable. > head(df) position response 1 0 1 2 3 1 3 -4 0 4 -1 ...
0
votes
0answers
31 views

Unwanted bold-face while putting multiple ggplot charts in the same file

I don't know if you have seen some unwanted bold-face font like picture below: As you see the third line is bold-faced, while the others are not. This happens to me when I try to use ggplot() with ...
0
votes
1answer
23 views

ggplot2 geom_density limits

How can I remove the lines at the end of the limits in calls to geom_density? Here is an example: library(ggplot2) set.seed(1234) dfGamma = data.frame(nu75 = rgamma(100, 0.75), nu1 = ...
0
votes
0answers
25 views

R ggplot2 stat_density2d fatal error

The function stat_density2d() in the package ggplot2 in R is causing a fatal error for me that crashes R. For example: > library("ggplot2") > n <- 15 > d <- data.frame(x=1:n+0.5, ...
1
vote
1answer
49 views

Fit decision boundary to logistic regression model in R

I'm struggling to plot a decision boundary in R using ggplot. I have 2 variables (exam scores) and a binary classification whether a student was admitted to school or not. The data looks like below: ...
2
votes
0answers
31 views

Vary the fill scale when using facet_wrap and geom_tile together

When using function geom_tile and facet_wrap together in ggplot2, how to set different limits of the aesthetic fill, as the option scales which can be set to be free/free_y/free_x in facet_wrap? The ...
0
votes
1answer
43 views

Change plot dimensions in ggplot2

I want to create a single pdf file and put several plots in it using package ggplot2. However I need to reduce the width of one specific plot, among all. Here is the code: invisible(pdf("foo.pdf")) ...
0
votes
1answer
25 views

Using plotmath in ggplot2 with percent sign (%)

I would like to use Greek characters, Latin characters and the percent sign in the facet labels of a ggplot2 bar chart. Greek characters can be done with 'facet_grid(.~variable, ...
-1
votes
1answer
37 views

Order y-axis of ggplot by another factor (not alphabetically) R

I've read a lot of Q&As on sorting the y-axis of a heatmap made in ggplot2 and thus feel bad writing yet another, but I cannot seem to achieve what I desire. (This probably is because I am new to ...

1 2 3 4 5 208
15 30 50 per page