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.
0
votes
0answers
12 views
Pairs Formula function programming in R, upper, middle lower levels [migrated]
I'm having a difficult time programming the pairs function in r, so i can setup upper, middle and lower panels of correlation, histogram and loess respectively. My panel Data looks like this: ...
1
vote
0answers
60 views
Is LOESS the appropriate way of visualizing my RT data?
I am conducting a Lexical Decision Task where my dependent random variable is Response Time (RT).
My experimental design consists of 5 blocks of a 100 trials each. In each block, 50% of trials ...
0
votes
0answers
26 views
plot error bar in ggplot [closed]
I have a data.frame looks like this:
Species mean sd se
name1 -20 1.1 0.23
name2 -24 1.2 1.23
name3 -28 0.4 0.19
...
...
and I used ...
3
votes
1answer
97 views
Graphical representation of cross-validation errors for regression
What are some good ways of presenting/comparing cross-validated RMSE errors for regression using various models, graphically via plots? As of now, I have been presenting the quantitative results in ...
4
votes
1answer
296 views
How does ggplot compute confidence intervals for regressions?
The R plotting package ggplot2 has an awesome function called stat_smooth for plotting a regression line (or curve) with the associated confidence band.
However I am having a hard time figuring out ...
1
vote
2answers
178 views
Plotting a model in R
I have used the vglm() function from the VGAM package to obtain a Weibull model for some data. I would like to plot the curve that this model is represented by. How do I do this?
Here's my input and ...
0
votes
0answers
183 views
Boxplots using ggplot2 [closed]
I am completely new to using ggplot2 but heard of its great plotting capabilities. I have a list with different samples and for each sample, I have sample observations according to three instruments. ...
5
votes
1answer
419 views
How do I create and interpret an interaction plot in ggplot2?
I am trying to make an interaction plot for this set of data,
but I want to make it with ggplot2. I am trying to predict VP using the predictors G and P, (these are columns in the dataset which I have ...
1
vote
3answers
400 views
How to compare dependent variables with different units using Grammar of Graphics paradigm?
My data analysis workflow is through R and ggplot2, in part because ggplot2 discourages me from making 'bad' (misleading, etc.) ...
9
votes
1answer
625 views
Getting different results when plotting 95% CI ellipses with ggplot or the ellipse package
I want to visualize the results of a clustering (produced with protoclust{protoclust}) by creating scater plots for each pair of variables used for classifying my ...
3
votes
1answer
293 views
Visualization of binned frequency distribution in R
I am trying to visually represent the distribution of last names in the US. Specifically, I am trying to show that the distribution is such that the most common names (say the top 50) are very common ...
4
votes
2answers
504 views
How to predict or extend regression lines in ggplot2?
I have a data frame that contains two time series: the dates and version numbers of Emacs and Firefox releases. Using one ggplot2 command it's easy to make a chart that uses loess (in a way that looks ...
5
votes
2answers
184 views
Temporal trend visualizations for regions
I try to reproduce a plot which I found in a publication (Mayor-Fernández et al 2012) showing unemployment rates across time for several regions. It combines a heatmap (?), a time series plot (lower ...
4
votes
0answers
188 views
Modeling a spline over time — design matrix and survey of approaches
A response variable y is a nonlinear function of a number of predictor variables X (in my real data the response is binomially distributed, but here I'm using a normally-distributed value for ...
2
votes
2answers
2k views
Plot a subset of categories on the x-axis in ggplot
everyone! I'm trying to plot pvalues of a test by categories (in this case, genetic loci). So, the x-axis contains gene names. I'm getting the plot to work, but the x-axis was very busy, so I am ...
6
votes
4answers
2k views
How to determine best cutoff point and it`s confidence interval using ROC curve in R?
I have the data of a test that could be used to distinguish normal and tumor cells. According to ROC curve it looks good for this purpose (area under curve is 0.9):
My questions are:
How to ...
5
votes
1answer
382 views
How to visualize both total counts of categories and proportions of subcategories in a plot?
Suppose I have samples drawn from categories A, B, C. Within those categories, I have subcategories d,e,f which are found in all 3 categories. I want to visualize how many samples I have form ...
0
votes
0answers
178 views
How to horizontally center ggplot, disregarding legend and axis labels? [closed]
I use ggplot2 to generate Tikz images which are placed on multiple pages of a LaTeX document. For consistency I'd like to center all of these plots, but the legends and axes can be a bit different in ...
12
votes
2answers
821 views
Are gridlines and grey backgrounds chartjunk and should they be used only on an exception basis?
It seems that most authorities agree that dark or otherwise prominent gridlines in plots are "chartjunk" by any reasonable definition and distract the viewer from the message in the main body of the ...
0
votes
1answer
428 views
Dropping unused levels in facets with ggplot2
Is it possible to drop levels that are not used in ggplot2s facets? This is my code:
...
1
vote
0answers
36 views
How to use ggplot to do the binned quantile plots(one type of scatter plot)? [duplicate]
Possible Duplicate:
How to do a pretty scatter plot in R?
How to use ggplot to do the binned quantile plots(one type of scatter plot)?
Hi all,
I have done scatter plot: plot(x, y).
Now I ...
10
votes
2answers
2k views
How to draw neat polygons around scatterplot regions in ggplot2
How do I add a neat polygon around a group of points on a scatterplot? I am using ggplot2 but am disappointed with the results of geom_polygon.
The dataset is over ...
1
vote
1answer
369 views
Problem printing greyscale or B&W ggplot2 images
I have an issue with printing/creating black and white and greyscale images with ggplot2.
I have been trying to make some black and white, and greyscale graphics for publication, they look perfect on ...
6
votes
1answer
895 views
Dirichlet distribution plot in R
I want to plot $15$ random draws of Dirichlet distribution with $\alpha = 1$ and dimension $n=10$ in R.
...
2
votes
1answer
879 views
How to plot a stair steps function with ggplot?
I have the graph like this:
R code for generating it is:
...
3
votes
3answers
509 views
How to plot a learning curve based on a sequence of date stamped successes and failures?
I have data on results of surgical operations:
date of operation (in YYYY-MM-DD format)
result of operation (0 for successful operation, 1 for unsuccessful operation)
Date is usually used only ...
1
vote
2answers
195 views
Grouping a “other” group with R and ggplot2
I'm trying to figure out, how to best deal with an "other" group or how to create one. I'm using R and ggplot2.
Data
As an example: I'm analyzing the german Bundestagswahl (general election, every ...
2
votes
1answer
2k views
Calculating standard error and attaching an error bar on ggplot2 bar chart
Given a minimal dataset where am looking for the occurrence of a certain motif within a dataset of 500 observations. with_motif represents obervations with the specified motif and without_motif are ...
2
votes
1answer
2k views
How to specify labels per facet in ggplot2?
I am using ggplot and I would like to label the scales in each facet of a plot manually. The concept is discussed here:
http://groups.google.com/group/ggplot2/browse_thread/thread/d2044ed0f91de98a
...
2
votes
1answer
588 views
What does this blur around the line mean in this graph?
I was playing around with ggplot2 using the following commands to fit a line to my data:
...
2
votes
3answers
2k views
How to compare two datasets with Q-Q plot using ggplot2?
As both a stats and R novice, I have been having a really difficult time trying to generate qqplots with an aspect ratio of 1:1. ggplot2 seems to offer far more control over plotting than the default ...
5
votes
1answer
106 views
Why is the tick marker for zero after the bar in this qplot bar chart?
Feature or bug? Why is it that the tick marker for zero projects is after the bar that represents the count for zero in this plot (instead of being in the middle as I'd have expected):
...
1
vote
1answer
427 views
Why is the y-axis in this R plot showing invalid percentage values?
Why are the percentages in the y-axis of this bar chart displayed incorrectly (values larger than 100%) and how can I fix it?
...
0
votes
1answer
195 views
How to add a label to the max value in R's ggplot2?
how can I add a label to the max value of this plot:
qplot(c, data=subset(df,c < 3000),geom="freqpoly")
c is just integers
3
votes
2answers
368 views
Plotting changes in a three-valued ordinal variable across two time points using R
I have a dataset with 4025 participants across two time points. I have scored them on a three-point categorical variable (Unlikely, Possible, Probable) at each time ...
9
votes
1answer
5k views
Boxplot with respect to two factors using ggplot2 in R
I am very new to R and to any packages in R. I looked at the ggplot2 documentation but could not find this. I want a box plot of variable boxthis with respect to ...
2
votes
1answer
672 views
How to add standard error to plots in ggplot2 with R?
I'm in the process of learning R, in the hope of replacing everything I do in SPSS/Sigmplot with R. It's going well so far :) I've got to the point of running a repeated-measures ANOVA, but have come ...
6
votes
1answer
220 views
Plotting multiple binhex with the same z levels
I have meteorological records for a point, these include temperature and solar irradiation. I want to plot them against another variable, that we shall call Rating, and see how the data are ...
5
votes
1answer
3k views
4
votes
2answers
1k views
7
votes
4answers
544 views
Annotating graphs in R
This is more of a "how to use R" question than an actual hardcore statistics question, but I think the concentration of R masters here makes this a good forum for it. I'm refreshing a time series ...
7
votes
2answers
2k views
How to draw funnel plot using ggplot2 in R?
As title, I need to draw something like this:
Can ggplot, or other packages if ggplot is not capable, be used to draw something like this?
22
votes
3answers
19k views
How can I change the title of a legend in ggplot2? [closed]
I have a plot I'm making in ggplot2 to summarize data that is from a 2 x 4 x 3 celled dataset. I have been able to make panels for the 2 leveled variable using facet_grid(. ~ Age) and to set the x ...
1
vote
1answer
532 views
Reorder categorical data in ggplot2
I have a series of boxplots that i am generating with ggplot2. I want to control the order in which they are displayed. Is there a way to control this order? I have two genotypes and i want them ...
4
votes
1answer
785 views
Calculating probability for bivariate normal distributions based on bootstrapped regression coefficients
Dear all,
I was encouraged to ask this question here as well as on stackoverflow and would be very appreciative of any answers...
Due to hetereoscedasticity I'm doing bootstrapped linear regression ...
6
votes
3answers
446 views
Visualizing two scalar variables over time
What would be the best way to display changes in two scalar variables (x,y) over time (z), in one visualization?
One idea that I had was to plot x and y both on the vertical axis, with z as the ...