Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AndreaCirilloAC/paletter
build your palette from a picture √
https://github.com/AndreaCirilloAC/paletter
dataviz palette r
Last synced: 3 months ago
JSON representation
build your palette from a picture √
- Host: GitHub
- URL: https://github.com/AndreaCirilloAC/paletter
- Owner: AndreaCirilloAC
- Created: 2017-05-11T19:59:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-29T01:29:49.000Z (almost 2 years ago)
- Last Synced: 2024-06-05T00:40:39.924Z (5 months ago)
- Topics: dataviz, palette, r
- Language: R
- Homepage:
- Size: 932 KB
- Stars: 100
- Watchers: 5
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - AndreaCirilloAC/paletter - build your palette from a picture √ (R)
README
# paletteR
PaletteR is an R package that is able to draw an optimised palette from a custom image. The palette is obtained by applying statistical learning to the image provided and optimising the distribution of colours.
More on the math behind the package can be found at:
http://www.andreacirillo.com/2018/05/08/how-to-use-paletter-to-automagically-build-palettes-from-pictures/
[![Rdoc](http://www.rdocumentation.org/badges/version/paletter)](http://www.rdocumentation.org/packages/paletter)
## example
Tondo Doni, Michelangelo Buonarroti, 1503-1504
## Installation
The package is currently only on Github. You can install it as follows:
```r
devtools::install_github("AndreaCirilloAC/paletter")
```## usage
```r
image_path <- "path_to_your_image"
colours_vector <- create_palette(image_path = image_path,
number_of_colors =32,
type_of_variable = “categorical")ggplot(data = mtcars, aes(x = rownames(mtcars),y = hp,color = rownames(mtcars),
fill = rownames(mtcars))) +
geom_bar(stat = 'identity') +
scale_color_manual(values = colours_vector) +
scale_fill_manual(values=colours_vector)+
theme_minimal() +
guides(size = FALSE) +
theme(legend.position = "bottom") +
labs(title = "disp vs hp")+
coord_flip()```