Git Product home page Git Product logo

Comments (7)

eliocamp avatar eliocamp commented on August 11, 2024 1

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.

g-pacheco avatar g-pacheco commented on August 11, 2024

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.

g-pacheco avatar g-pacheco commented on August 11, 2024

I hope you will manage to find a solution. It would be great to have this option.

from ggnewscale.

eliocamp avatar eliocamp commented on August 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.