Comments (2)
Hi Zach,
The issue here is that you are (correctly) using the fill
aesthetic, but trying to modify it with scale_colour_*()
functions instead of scale_fill_*()
functions. For the first example, if you use scale_fill_gradient2()
it should work as expected:
ggplot(example_genes, aes(xmin = start, xmax = end, y = molecule, fill = start)) +
geom_gene_arrow() +
facet_wrap(~ molecule, scales = "free", ncol = 1) +
scale_fill_gradient2()
Created on 2021-12-15 by the reprex package (v2.0.1.9000)
For the second example, if you just change scale_colour_brewer()
to scale_fill_brewer()
, you'll get an error because the Brewer scales (as implemented in ggplot2) are designed for discrete variables:
ggplot(example_genes, aes(xmin = start, xmax = end, y = molecule, fill = start)) +
geom_gene_arrow() +
facet_wrap(~ molecule, scales = "free", ncol = 1) +
scale_fill_brewer(palette = "Greens")
#> Error: Continuous value supplied to discrete scale
Created on 2021-12-15 by the reprex package (v2.0.1.9000)
Instead you can use the scale_*_distiller()
functions which will interpolate the Brewer palettes for continuous variables:
ggplot(example_genes, aes(xmin = start, xmax = end, y = molecule, fill = start)) +
geom_gene_arrow() +
facet_wrap(~ molecule, scales = "free", ncol = 1) +
scale_fill_distiller(palette = "Greens")
Created on 2021-12-15 by the reprex package (v2.0.1.9000)
from gggenes.
Oh of course! Thank you the quick reply!
from gggenes.
Related Issues (20)
- R 3.6 requirement HOT 1
- Nudge overlapping feature labels HOT 1
- Error in grid.Call HOT 1
- Circular View of genome HOT 4
- put gggenes x-axes on common scale HOT 8
- conflicts between gggenomes and gggenes HOT 1
- conflicts between "make_alignment_dummies()" and "forward" aesthetic HOT 2
- Gene cluster orientation reverse complements HOT 3
- Equal scaling between different figures HOT 2
- Features without arrows HOT 1
- Forward not working? HOT 2
- Add feature fail. HOT 3
- removing distance between line and arrows HOT 3
- add sigle label in x axis !!! HOT 1
- Issues with theme_genes() HOT 2
- rjcommon.h:11:10: fatal error: jpeglib.h: No such file or directory HOT 1
- theme_genes() produces error HOT 3
- Can you modify the length of the following genomic region HOT 3
- Terminator point feature HOT 5
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 gggenes.