Showing posts with label ggplot2. Show all posts
Showing posts with label ggplot2. Show all posts

Saturday, January 30, 2021

ggfittext

ggfittext provides some useful text displaying capability to ggplot2, including a new geom called geom_bar_text

Monday, November 30, 2020

Getting past the little hiccups to getting plotly animations into slides

 Very helpful post regarding how to use plotly graph in xaringan slides. 

Thursday, November 29, 2018

Saturday, November 24, 2018

Tuesday, February 02, 2016

ggplot2 extensions

Here is a list of ggplot2 extension packages.

Thursday, March 05, 2015

Cheatsheet for ggplot2

Here is a cheatsheet for the ggplot2 package.

Thursday, November 21, 2013

Sunday, November 10, 2013

Friday, October 11, 2013

Using Zelig and ggplot2 together

I am not the only person doing that, apparently. Here is an example.

Tuesday, November 20, 2012

Extra themes for ggplot2

Ggthemes is a new package that provides additional themes for ggplot2. It can even be used to draw a Stata-like graph. I particularly like the Tufte-style, as outlined in The Visual Display of Quantitative Information. 

Thursday, October 18, 2012

Saturday, June 02, 2012

Drawing a map

This post explains how to draw a China map using ggplot2 and online data sources. The blog is generally interesting.

This one is based on OpenStreetMap. Very helpful.

Tuesday, June 28, 2011

Use JAGS with ggplot2

Here is a short demo of how to use JAGS with ggplot2.

Sunday, May 22, 2011

Legends in ggplot2

A simple plot takes a few lines of coding:


g1 <- ggplot(d, aes(birth.year))


g2 <- g1 + geom_line(aes(y=alive0, linetype="Famale")) + 
geom_line(aes(y=alive1, linetype="Male")) + scale_linetype_discrete(name = "")


g3 <- g2 + geom_point(aes(y=alive0, shape="Famale")) + 
geom_point(aes(y=alive1, shape="Male")) + scale_x_continuous("") + scale_y_continuous("Proportion Alive in 1982") + opts(legend.position=c(.24, .95), legend.justification = c(1, 1)) + scale_shape_discrete(name="")


g4 <- g3 + labs(fill="")


Tuesday, March 15, 2011

Labels and legends in ggplot2 figure

I struggled with getting the labels and legends right in my ggplot2 figure and found this web page very helpful.

Here are some discussions about how to change the font size for the labels.

Sunday, February 13, 2011

A few summary functions used by ggplot2

I could not quite figure out what the summary function "mean_sdl" stands for, so I took at a look at the source code "stat-summary.r". It turns out that this is a wrapper function of the "smean_sdl()" of the Hmisc package, as well as the "median_hilow", "mean_cl_normal" and "mean_cl_boot".

Friday, October 29, 2010

Ggplot2, some tricks

Here is how to remove the grey in the background as well as the grid, a modification of the default black/white theme.

Counter