-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
75 lines (58 loc) · 1.71 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ggnuplot
<!-- badges: start -->
<!-- badges: end -->
ggnuplot is a [ggplot2](https://ggplot2.tidyverse.org/) theme that makes your
ggplots look like [gnuplots](http://www.gnuplot.info/). This may be helpful if
you use both ggplot2 and gnuplot in one project.
## Installation
You can install the development version of ggnuplot from
[GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("hriebl/ggnuplot")
```
## Examples
ggnuplot features inward ticks and secondary axes. It also comes with gnuplot's
default color palette. Here is what it looks like:
```{r example1, dpi = 300, fig.width = 10}
library(ggplot2)
library(ggnuplot)
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
geom_point() +
scale_color_gnuplot() +
scale_x_gnuplot() +
scale_y_gnuplot() +
theme_gnuplot()
```
And one example with facets:
```{r example2, dpi = 300, fig.width = 10, message = FALSE, warning = FALSE}
set.seed(1337)
df <- data.frame(
y = rnorm(2000),
x = rep(1:500, times = 4),
cat1 = rep(c("Foo", "Bar", "Foo", "Bar"), each = 500),
cat2 = rep(c("Wibble", "Wobble"), each = 1000)
)
ggplot(df, aes(x, y)) +
geom_line(color = gnucolors[1]) +
geom_smooth(color = gnucolors[1], size = 1.5, se = FALSE) +
facet_grid(vars(cat1), vars(cat2)) +
xlab("MCMC Iterations") +
ylab(NULL) +
scale_x_gnuplot(expand = c(0, 0)) +
scale_y_gnuplot(limits = c(-3.5, 3.5)) +
theme_gnuplot()
```
I wish my samplers worked that well!