Comments (7)
Yes, this is an idea that's not implemented.
In fact, after I opened the issue I realised that is not as easy to do because new_scale() renames the previous entries.
from ggnewscale.
Hello @eliocamp,
I am sorry but I am not sure if I could not understand well what you suggested. Was it something like this? With this command I get the following error:
Error in new_scale("alpha", "Layka") : unused argument ("Layka")
ggplot() +
geom_raster(data = Salinity_df_r, aes(x = x, y = y, fill = Present.Surface.Salinity.Mean)) +
scale_fill_viridis_c(option = "G", direction = -1) +
geom_sf(data = Global, fill = "#fff7f3", colour = "#000000") +
new_scale("alpha", "Layka") +
geom_star(data = Coors_Grouped, aes(x = Longitude, y = Latitude, starshape = Group, fill = BioState),
size = 6) +
coord_sf(xlim = c(-11, 31), ylim = c(67, 49.75), expand = FALSE) +
scale_starshape_manual(values = Shapes) +
scale_x_continuous(breaks = seq(-10, 32, by = 10)) +
scale_y_continuous(breaks = c(50, 58, 66)) +
annotation_north_arrow(location = "br", which_north = "false", style = north_arrow_fancy_orienteering,
height = unit(2.5, "cm"), width = unit(3, "cm"),
pad_x = unit(2.75, "in"), pad_y = unit(.4, "in")) +
annotation_scale(location = "br", line_width = 2, text_cex = 1.35, style = "ticks", pad_y = unit(.3, "in")) +
theme(panel.background = element_blank(),
panel.border = element_rect(colour = "black", size = .5, fill = NA),
panel.grid.major = element_line(color = "#000000", linetype = "dashed", size = .00005),
plot.margin = margin(t = .005, b = .005, r = .2, l = .2, unit = "cm"),
legend.background = element_rect(size = .15, color = "#000000", fill = "#fff7f3", linetype = "dotted"),
legend.key = element_blank(),
legend.position = c(.142, .8675),
axis.title = element_blank(),
axis.text = element_text(colour = "#000000", size = 15, face = "bold"),
axis.ticks = element_line(color = "black", size = .5)) +
guides(fill = guide_colourbar(title = "Salinity", title.theme = element_text(size = 16, face = "bold"),
label.theme = element_text(size = 14, face = "bold"), label.position = "top",
barwidth = 12.3, barheight = 1, order = 1, frame.linetype = 1, frame.colour = "#000000",
ticks.colour = "#ffffff", direction = "horizontal", reverse = TRUE, even.steps = TRUE,
draw.ulim = TRUE, draw.llim = TRUE),
starshape = guide_legend(title = "Sampling Localities", title.theme = element_text(size = 16, face = "bold"),
label.theme = element_text(size = 14),
override.aes = list(starshape = Shapes, size = 4), order = 2))
Thanks in advance, George.
from ggnewscale.
I hope you will manage to find a solution. It would be great to have this option.
from ggnewscale.
In the meantime, take a look at relayer, which already implements this but with a different syntax.
https://github.com/clauswilke/relayer
from ggnewscale.
Related Issues (20)
- new scale for x/y? HOT 2
- `override.aes` is ignored with `aesthetics = c("fill", "color")` when using `{ggnewscale}` HOT 2
- Release ggnewscale 0.4.7
- Multiple new_scale_fill doesn't work. HOT 9
- Support for plotly HOT 4
- Release ggnewscale 0.4.8
- Issue When Trying to Employ `guide_colourbar` ::::: v0.4.8 HOT 5
- Legend issues when using `guides(...)` HOT 4
- ggnewscale CRAN note HOT 3
- Issues with next version of ggplot2 HOT 4
- Question on overriding scales on a pre-existing ggnewscale plot HOT 3
- Release ggnewscale 0.4.9
- Release ggnewscale 0.4.10
- new_scale_colour does not work with a scale_* function that includes a guide argument HOT 4
- `guide` vs. `show.legend` with `new_scale()` HOT 4
- Does not display two scales HOT 2
- Release ggnewscale 0.5.0
- Release ggnewscale 0.4.10 HOT 4
- new_scale_*() throws an error in ggplot2 3.5.0 HOT 4
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 ggnewscale.