Skip to content

Commit

Permalink
Merge pull request #57 from jonocarroll/new_logo
Browse files Browse the repository at this point in the history
New logo
  • Loading branch information
jonocarroll authored Aug 22, 2020
2 parents bc91529 + c2f1fc0 commit f76acd2
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 106 deletions.
10 changes: 7 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ knitr::opts_chunk$set(
)
```

# ggeasy <img src='man/figures/logo.png' align="right" height="138.5" />
# ggeasy <img src='man/figures/logo.gif' align="right" height="138.5" />
<!-- http://www.clker.com/clipart-2-puzzle-pieces-connected.html -->

[![Covrpage Summary](https://img.shields.io/badge/covrpage-Last_Build_2020_03_07-yellowgreen.svg)](https://github.com/jonocarroll/ggeasy/blob/master/tests/README.md)
Expand All @@ -27,8 +27,8 @@ You know how to make `ggplot2` graphics, right? No worries. Piece of cake.
Now, can you please rotate the `x` axis labels to vertical?

![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/xkcd.png)
![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/winona.gif)
![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/sherlock.gif)
<!-- ![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/winona.gif) -->
<!-- ![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/sherlock.gif) -->

`ggeasy` is here to make that a little easier.

Expand Down Expand Up @@ -137,3 +137,7 @@ ggplot(mtcars, aes(wt, mpg)) +
easy_remove_y_axis(what = "ticks", teach = TRUE)
```

## Credits

Many thanks to [Sébastien Rochette (\@statnmap)](https://statnmap.com/) for
the design and execution of the hex logo.
185 changes: 82 additions & 103 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# ggeasy <img src='man/figures/logo.png' align="right" height="138.5" />
ggeasy <img src='man/figures/logo.gif' align="right" height="138.5" />
======================================================================

<!-- http://www.clker.com/clipart-2-puzzle-pieces-connected.html -->

Expand All @@ -19,31 +20,28 @@ status](https://www.r-pkg.org/badges/version/ggeasy)](https://CRAN.R-project.org
You know how to make `ggplot2` graphics, right? No worries. Piece of
cake.

Now, can you please rotate the `x` axis labels to
vertical?
Now, can you please rotate the `x` axis labels to vertical?

![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/xkcd.png)
![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/winona.gif)
![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/sherlock.gif)
<!-- ![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/winona.gif) -->
<!-- ![](https://raw.githubusercontent.com/jonocarroll/ggeasy/master/inst/media/sherlock.gif) -->

`ggeasy` is here to make that a little easier.

## Installation
Installation
------------

You can install the latest released version of `ggeasy` from CRAN with:

``` r
install.packages("ggeasy")
```
install.packages("ggeasy")

or the bleeding-edge development version from GitHub with

``` r
# install.packages("remotes")
remotes::install_github("jonocarroll/ggeasy")
```
# install.packages("remotes")
remotes::install_github("jonocarroll/ggeasy")

## Reference
Reference
---------

See the [`pkgdown` site](https://jonocarroll.github.io/ggeasy/).

Expand All @@ -54,147 +52,128 @@ walkthrough using `ggeasy` which covers some of the major features:
[![Watch the
video](https://img.youtube.com/vi/iAH1GJoBZmI/maxresdefault.jpg)](https://youtu.be/iAH1GJoBZmI)

## Examples
Examples
--------

``` r
library(ggplot2)
library(ggeasy)
library(ggplot2)
library(ggeasy)

# rotate x axis labels
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
easy_rotate_x_labels()
```
# rotate x axis labels
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
easy_rotate_x_labels()

![](man/figures/example-1.png)<!-- -->

``` r

# rotate y axis labels
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
easy_rotate_y_labels()
```
# rotate y axis labels
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
easy_rotate_y_labels()

![](man/figures/example-2.png)<!-- -->

``` r

# remove 'size' legend
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() +
easy_remove_legend(size)
```
# remove 'size' legend
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() +
easy_remove_legend(size)

![](man/figures/example-3.png)<!-- -->

``` r

# make the x axis labels larger
ggplot(mtcars, aes(mpg, hp)) +
geom_point() +
easy_x_axis_labels_size(22)
```
# make the x axis labels larger
ggplot(mtcars, aes(mpg, hp)) +
geom_point() +
easy_x_axis_labels_size(22)

![](man/figures/example-4.png)<!-- -->

``` r

# make all the text red
ggplot(mtcars, aes(mpg, hp)) +
geom_point(aes(fill = gear)) +
easy_all_text_color("red")
```
# make all the text red
ggplot(mtcars, aes(mpg, hp)) +
geom_point(aes(fill = gear)) +
easy_all_text_color("red")

![](man/figures/example-5.png)<!-- -->

``` r

# remove just x axis
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
easy_remove_x_axis()
```
# remove just x axis
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
easy_remove_x_axis()

![](man/figures/example-6.png)<!-- -->

``` r

# remove y axis ticks
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
easy_remove_y_axis(what = "ticks")
```
# remove y axis ticks
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
easy_remove_y_axis(what = "ticks")

![](man/figures/example-7.png)<!-- -->

``` r

# move legends to bottom
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() +
easy_move_legend("bottom")
```
# move legends to bottom
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() +
easy_move_legend("bottom")

![](man/figures/example-8.png)<!-- -->

``` r

# move legend to left side
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() +
easy_legend_at("left")
```
# move legend to left side
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() +
easy_legend_at("left")

![](man/figures/example-9.png)<!-- -->

``` r

# Make legends horizontal
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() + easy_rotate_legend("horizontal")
```
# Make legends horizontal
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
geom_point() + easy_rotate_legend("horizontal")

![](man/figures/example-10.png)<!-- -->

``` r

# use labelled variables
iris_labs <- iris
labelled::var_label(iris_labs$Species) <- "Flower\nSpecies"
labelled::var_label(iris_labs$Sepal.Length) <- "Length of Sepal"
iris_labs_2 <- iris_labs
labelled::var_label(iris_labs_2$Species) <- "Sub-genera"
# use labelled variables
iris_labs <- iris
labelled::var_label(iris_labs$Species) <- "Flower\nSpecies"
labelled::var_label(iris_labs$Sepal.Length) <- "Length of Sepal"
iris_labs_2 <- iris_labs
labelled::var_label(iris_labs_2$Species) <- "Sub-genera"

# use variable labels automatically
ggplot(iris_labs, aes(x = Sepal.Length, y = Sepal.Width)) +
geom_line(aes(colour = Species)) +
geom_point(data = iris_labs_2, aes(fill = Species), shape = 24) +
easy_labs()
```
# use variable labels automatically
ggplot(iris_labs, aes(x = Sepal.Length, y = Sepal.Width)) +
geom_line(aes(colour = Species)) +
geom_point(data = iris_labs_2, aes(fill = Species), shape = 24) +
easy_labs()

![](man/figures/example-11.png)<!-- -->

These functions will try to teach you the ‘official’ way to achieve
these goal, usually via the `teach` argument (where implemented)

``` r
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
easy_rotate_y_labels(angle = "startatbottom", teach = TRUE)
#> easy_rotate_y_labels call can be substituted with:
#> theme(axis.text.y = element_text(angle = 90, hjust = 0))
```
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
easy_rotate_y_labels(angle = "startatbottom", teach = TRUE)
#> easy_rotate_y_labels call can be substituted with:
#> theme(axis.text.y = element_text(angle = 90, hjust = 0))

![](man/figures/teach-1.png)<!-- -->

``` r

ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
easy_remove_y_axis(what = "ticks", teach = TRUE)
#> easy_remove_y_axis call can be substituted with:
#> theme(axis.ticks.y = element_blank())
```
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
easy_remove_y_axis(what = "ticks", teach = TRUE)
#> easy_remove_y_axis call can be substituted with:
#> theme(axis.ticks.y = element_blank())

![](man/figures/teach-2.png)<!-- -->

Credits
-------

Many thanks to [Sébastien Rochette (@statnmap)](https://statnmap.com/)
for the design and execution of the hex logo.
Binary file modified man/figures/example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/example-9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/logo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/teach-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/teach-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f76acd2

Please sign in to comment.