Comments (4)
Add col_limits, as this is the way to drop stuff
from ggblanket.
library(tidyverse)
library(palmerpenguins)
breaks <- c("Chinstrap", "Adelie", "Another one", "Gentoo")
values <- c("green", "blue", "pink", "red")
pal_df <- tibble::tibble(breaks, values)
p <- penguins %>%
mutate(species = as.character(species)) %>%
ggplot() +
geom_point(aes(flipper_length_mm, body_mass_g, col = species))
p +
scale_color_manual(values = pal_df$values,
breaks = pal_df$breaks,
limits = pal_df$breaks
)
from ggblanket.
Also continuous colours
p <- penguins %>%
mutate(species = as.character(species)) %>%
ggplot() +
geom_point(aes(flipper_length_mm, body_mass_g, col = body_mass_g))
breaks <- pretty(penguins$body_mass_g, 2)
p +
scale_color_gradientn(colors = viridis::viridis(100),
breaks = breaks,
limits = c(min(breaks), max(breaks))
)
from ggblanket.
Sorted :)
from ggblanket.
Related Issues (20)
- time: does not work with all combos of x_limits and x_breaks
- time: y variable of time class does not work HOT 2
- sf: not able to set positional `*_limits`, `*_breaks` and `*_include` HOT 1
- pipes: change %>% to |> and remove magrittr dependency HOT 1
- DESCRIPTION: remove grid and hms HOT 2
- messages: messages about repeating positional scales
- messages: non-polygon plots have message re ignoring `fill` HOT 1
- messages: qq plot has message re ignoring `stat`
- messages: gg_smooth is repeating messages HOT 1
- messages: gg_histogram and gg_freqpoly are repeating messages HOT 1
- pal_dark_mode: plot background colour is not in flow with the panel HOT 2
- docs: speed and shiny HOT 1
- docs: str_keep_seq in vignette HOT 1
- *_breaks_n: improve estimate of n
- Default breaks needs to calculate based on the sum of the limits and expand HOT 1
- pal: change default continuous to mako
- col_breaks: does not seem to be working HOT 1
- pal: does not always get col_n right HOT 1
- stat: support using a stat function HOT 1
- col code not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ggblanket.