3016 search results for "ggplot2"

ggloop: An R package to create multiple ggplot2 plots

November 10, 2016
By
ggloop: An R package to create multiple ggplot2 plots

ggloop is an R package which creates multiple ggplot2 plots with a single function call. The main function, ggloop(), accepts vectors of aesthetics via aes_loop(), which allows ggloop() to generate multiple plots. To read more about this package (which is available on CRAN), you can check out the package website which was built with pkgdown (formerly

Read more »

Make A Box Plot with Single Column Data Using Ggplot2 Tutorial

November 7, 2016
By
Make A Box Plot with Single Column Data Using Ggplot2 Tutorial

Last week I had my class practice making a box plot using the data on page 66 in The Practice of Statistics 4th Edition (TPS 4ed) text book. I’m still going over the details of making a box plot with just a single vector or variable of data. Many of the problems in our textbook

Read more »

ggplot2 axis limit gotchas

ggplot2 axis limit gotchas

Setting axis limits in ggplot has behaviour that may be unexpected: any data that falls outside of the limits is ignored, instead of just being hidden. This means that if you are apply a statistic or calculation on the data, like plotting a box and whi...

Read more »

How to add a background image to ggplot2 graphs

October 29, 2016
By
How to add a background image to ggplot2 graphs

When producing so called infographics, it is rather common to use images rather than a mere grid as background. In this blog post, I will show how to use a background image with ggplot2. Packages required The following code will install load and / or install the R packages required for this blog post. if Related Post

Read more »

Plotting individual observations and group means with ggplot2

October 26, 2016
By
Plotting individual observations and group means with ggplot2

@drsimonj here to share my approach for visualizing individual observations with group means in the same plot. Here are some examples of what we’ll be creating: I find these sorts of plots to be incredibly useful for visualizing and gaining insight into our data. We often visualize group means only,...

Read more »

Annotated Facets with ggplot2

October 20, 2016
By
Annotated Facets with ggplot2

I was recently asked to do a panel of grouped boxplots of a continuous variable, with each panel representing a categorical grouping variable. This seems easy enough with ggplot2 and the facet_wrap function, but then my collaborator wanted p-values on the graphs! This post is my approach to the problem. First of all, one caveat. I’m a

Read more »

How to create a fast and easy heatmap with ggplot2

October 17, 2016
By
How to create a fast and easy heatmap with ggplot2

The heatmaps are a tool of data visualization broadly widely used with biological data. The concept is to represent a matrix of values as colors where usually is organized by a gradient. We can find a large number of these graphics in scientific articles related with gene expressions, such as microarray or RNA-seq. In the next example, … Continue...

Read more »

Mapping (historic) tracks in ggplot2

October 10, 2016
By

This tutorial was first published in “Geocomputation a Practical Primer“. Here is a more complex example showing how to produce a map of 18th Century Shipping flows. The data have been obtained from the CLIWOC project and they represent a sample of digitised ships’ logs from the 18th Century. We are using a very small

Read more »

Scalable plotting with ggplot2 – Part I

Scalable plotting with ggplot2 – Part I

Introduction This series discusses how we can use ggplot2 to produce plots for each column of a data frame that depend on characteristics of this column (e.g. the class of a column) in a scalable manner. To this end, we integrate the following concepts / functions:

Read more »

Introducing artyfarty: a theming package for ggplot2

October 5, 2016
By
Introducing artyfarty: a theming package for ggplot2

In the last few years, I’ve been using ggplot2 quite a lot. While the ggplot2 default theme is quite slick, I started tweaking the theme to fit my own taste and/or that of the target audience. artyfarty is a collection of a few themes that I have us...

Read more »

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)