Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hriebl/ggnuplot
Make your ggplots look like gnuplots
https://github.com/hriebl/ggnuplot
data-visualization ggplot2 ggplot2-theme r visualization
Last synced: about 2 months ago
JSON representation
Make your ggplots look like gnuplots
- Host: GitHub
- URL: https://github.com/hriebl/ggnuplot
- Owner: hriebl
- License: other
- Created: 2020-02-08T00:01:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T14:49:06.000Z (over 4 years ago)
- Last Synced: 2024-10-30T05:05:29.232Z (about 2 months ago)
- Topics: data-visualization, ggplot2, ggplot2-theme, r, visualization
- Language: R
- Size: 2.45 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# ggnuplot
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!