Giter Club home page Giter Club logo

Comments (5)

rCarto avatar rCarto commented on August 18, 2024

In choroLayer() you can set the number of decimals displayed in the legend with the legend.values.rnd argument (set to 0 by default).

from cartography.

jeffcsauer avatar jeffcsauer commented on August 18, 2024

@rCarto thank you for the rapid response! Is there a way to set labels to the legend that DO NOT correspond to teh breaks?

For example, if I wanted to do (1,2,3,4,5,6) for each of (0,0.2,0.4,0.6,0.8,1)?

Best,

Jeff

from cartography.

rCarto avatar rCarto commented on August 18, 2024

Sure, you can use legendChoro() :

library(cartography)
library(sf)
#> Linking to GEOS 3.5.1, GDAL 2.2.3, PROJ 4.9.3
mtq <- st_read(system.file("gpkg/mtq.gpkg", package="cartography"), quiet = T)
cols <- carto.pal("wine.pal", 6)
choroLayer(x = mtq, var = "MED", legend.pos = "n", col = cols)
legendChoro(pos = "topright", title.txt = "Legend title", 
            breaks = c(0,1,2,3,4,5,"max value"),
            col = cols, nodata = FALSE)

Created on 2019-03-26 by the reprex package (v0.2.1)

from cartography.

jeffcsauer avatar jeffcsauer commented on August 18, 2024

@rCarto absolutely fantastic! For whatever reason your package is much more intuitive to me compared to others. Definitely going to recommend to coworkers and implement in work!

from cartography.

rCarto avatar rCarto commented on August 18, 2024

Thank you!

from cartography.

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.