An open API service indexing awesome lists of open source software.

https://github.com/ahasverus/rsphere

:package: Plot a 2D Shaded Sphere
https://github.com/ahasverus/rsphere

plot r sf shade sphere

Last synced: 3 months ago
JSON representation

:package: Plot a 2D Shaded Sphere

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%"
)
```

# rsphere

[![R build status](https://github.com/ahasverus/rsphere/workflows/R-CMD-check/badge.svg)](https://github.com/ahasverus/rsphere/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)

The goal of rsphere is to plot a 2D shaded sphere with a two-colours gradient.

## Installation

You can install the development version from [GitHub](https://github.com/ahasverus/rsphere) with:

``` r
# install.packages("remotes")
remotes::install_github("ahasverus/rsphere")
```

## Usage

```{r}
plot(x = 0, y = 0, asp = 1, xlim = c(-1, 1), ylim = c(-1, 1), axes = FALSE, ann = FALSE)
rsphere::add_sphere()
```

```{r}
plot(x = 0, y = 0, asp = 1, xlim = c(-1, 1), ylim = c(-1, 1), axes = FALSE, ann = FALSE)
rsphere::add_sphere(x1 = 0.5, y1 = -0.5, col = c("black", "red"))
```