3590 search results for "ggplot"

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 »

Make ggplot graphics2 interactive with ggiraph

October 10, 2016
By

R's ggplot2 package is a well-known tool for producing beautiful static data visualizations that you can include in a printed report. But what if you want to include a ggplot2 graphic on a webpage and provide the ability for the user to interact with the data? The ggiraph package by David Gohel (available for installation via CRAN). WIth ggiraph,...

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 »

Intro to R Programming | AP Statistics Histograms with ggplot

October 8, 2016
By
Intro to R Programming | AP Statistics Histograms with ggplot

I will continue to work out of the The Practice Of Statistics 4th edition book and recreate some histograms. I used the data on page 35 in Chapter 1. My students will be getting this lesson this week. After they make their firs histograms, I’ll have them compare the R histogram to the histogram on

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)