All Projects → brodieG → ggbg

brodieG / ggbg

Licence: other
Miscellaneous Ggplot2 Extensions

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to ggbg

Ggdistribute
ggplot2 extension for plotting distributions
Stars: ✭ 16 (-23.81%)
Mutual labels:  ggplot2, ggplot-extension
Ggbernie
A ggplot2 geom for adding Bernie Sanders to ggplot2
Stars: ✭ 96 (+357.14%)
Mutual labels:  ggplot2, ggplot-extension
Hrbrthemes
🔏 Opinionated, typographic-centric ggplot2 themes and theme components
Stars: ✭ 899 (+4180.95%)
Mutual labels:  ggplot2, ggplot-extension
Ggalt
🌎 Extra Coordinate Systems, Geoms, Statistical Transformations & Scales for 'ggplot2'
Stars: ✭ 561 (+2571.43%)
Mutual labels:  ggplot2, ggplot-extension
Patchwork
The Composer of ggplots
Stars: ✭ 2,002 (+9433.33%)
Mutual labels:  ggplot2, ggplot-extension
Ggforce
Accelerating ggplot2
Stars: ✭ 640 (+2947.62%)
Mutual labels:  ggplot2, ggplot-extension
Ggpol
🌍 Parliament diagrams and more for ggplot2
Stars: ✭ 71 (+238.1%)
Mutual labels:  ggplot2, ggplot-extension
Ggcats
The geom you always wished for adding cats to ggplot2
Stars: ✭ 34 (+61.9%)
Mutual labels:  ggplot2, ggplot-extension
Ggh4x
ggplot extension: options for tailored facets, multiple colourscales and miscellaneous
Stars: ✭ 148 (+604.76%)
Mutual labels:  ggplot2, ggplot-extension
Lemon
🍋 Lemon --- Freshing up your ggplots
Stars: ✭ 147 (+600%)
Mutual labels:  ggplot2, ggplot-extension
Ggsignif
Easily add significance brackets to your ggplots
Stars: ✭ 322 (+1433.33%)
Mutual labels:  ggplot2, ggplot-extension
Calendr
Ready to print calendars with ggplot2
Stars: ✭ 161 (+666.67%)
Mutual labels:  ggplot2, ggplot-extension
Ggpointdensity
📈 📊 Introduces geom_pointdensity(): A Cross Between a Scatter Plot and a 2D Density Plot.
Stars: ✭ 286 (+1261.9%)
Mutual labels:  ggplot2, ggplot-extension
Ggraph
Grammar of Graph Graphics
Stars: ✭ 815 (+3780.95%)
Mutual labels:  ggplot2, ggplot-extension
ggdogs
The geom you always wished for adding dogs to ggplot2
Stars: ✭ 28 (+33.33%)
Mutual labels:  ggplot2, ggplot-extension
Gganimate
A Grammar of Animated Graphics
Stars: ✭ 1,744 (+8204.76%)
Mutual labels:  ggplot2, ggplot-extension
Econocharts
Microeconomics/macroeconomics charts in ggplot2
Stars: ✭ 161 (+666.67%)
Mutual labels:  ggplot2, ggplot-extension
Gghalves
✂️ Easy half-half geoms in ggplot2
Stars: ✭ 174 (+728.57%)
Mutual labels:  ggplot2, ggplot-extension
sportyR
R package for drawing regulation playing surfaces for several sports
Stars: ✭ 84 (+300%)
Mutual labels:  ggplot2
value-investing-studies
Data Analysis Studies on Value Investing
Stars: ✭ 66 (+214.29%)
Mutual labels:  ggplot2

ggbg - Assorted Ggplot Extensions

Assorted experimental ggplot2 extensions. This package is partly a learning exercise for myself, so not all contents will be useful to others.

position_waterfall

A position adjustment that both stacks and dodges bars to create waterfall charts:

set.seed(1)
p <- ggplot(data.frame(x=1:20, y=rnorm(20)), aes(x=x, y=y, fill=y > 0))
p + geom_col()
p + geom_col(position='waterfall')

plot of chunk waterfallplot of chunk waterfall

It is primarily intended for geom_col, but can be used with arbitrary geoms:

p + geom_point()
p + geom_point(position=position_waterfall(vjust=1))

plot of chunk geomsplot of chunk geoms

If you use arbitrary geoms you may need to adjust position with vjust as we do here as otherwise the graphical elements are centered between the end of the previous cumulative value and the beginning of the next. Please see ?position_watefall for details.

It is can also be used with stats:

dat.norm <- data.frame(x=rnorm(1000))
ggplot(dat.norm, aes(x=x)) + stat_bin()
ggplot(dat.norm, aes(x=x)) + stat_bin(position='waterfall')

plot of chunk statsplot of chunk stats

For more examples try example(position_waterfall, package='ggbg').

geom_car

Plot cars! This geom was implemented on a lark as an answer to an SO Question.

ggplot(
  geom.car.data,  # ggbg data set
  aes(x=x, y=y, length=length, width=width, fill=label)
) +
geom_hline(yintercept=seq(5, 35, by=10), color="white", size=2, linetype=2) +
geom_car() +
coord_equal() +
theme(panel.background = element_rect(fill="#555555"),
  panel.grid.major = element_blank(),
  panel.grid.minor = element_blank())

plot of chunk geom-car

Installation

This package is currently github-only. You can get it with devtools::install_github('brodieg/ggbg') or:

f.dl <- tempfile()
f.uz <- tempfile()
github.url <- 'https://github.com/brodieG/ggbg/archive/master.zip'
download.file(github.url, f.dl)
unzip(f.dl, exdir=f.uz)
install.packages(file.path(f.uz, 'ggbg-master'), repos=NULL, type='source')
unlink(c(f.dl, f.uz))

Related Packages

Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].