Questions tagged [choropleth]

A choropleth map is a thematic map in which areas are shaded or patterned in proportion to the measurement of the statistical variable being displayed on the map.

A choropleth map is a thematic map in which areas are shaded or patterned in proportion to the measurement of the statistical variable being displayed on the map. For the R package choroplethr, please use the choroplethr tag.

757 questions
64
votes
2 answers

How do I change the NA color from gray to white in a ggplot choropleth map?

I am trying to create a choropleth map of the US that has the default color changed from gray to white. I have records for 18 of 48 states and the code works to color by value, but for those states where I have no records the states are gray. I…
user2320821
  • 1,141
  • 3
  • 13
  • 19
53
votes
1 answer

Choropleth map using folium and pandas

I am using folium to create a choropleth map of a set of countries. I am following the documentation. However. for some reason the map doesn't show any shades. I am using the world geojson from natural earth (see the gist). My dataframe looks…
goofd
  • 2,028
  • 2
  • 21
  • 33
32
votes
3 answers

Error: isTRUE(gpclibPermitStatus()) is not TRUE

This question may be a duplicate of an earlier unanswered one. I still have the problem. I am trying to use a zipcode shapefile and coming up with the following error: tract <- readOGR(dsn = ".", layer =…
garson
  • 1,505
  • 3
  • 22
  • 56
26
votes
1 answer

How do I set each plotly subplot title during graph creation loop?

I understand that if I want to set all of the subplot titles then I can do that when I declare the figure. import pandas as pd import plotly.graph_objs as go from plotly.subplots import make_subplots fig = make_subplots( ### …
wex52
  • 475
  • 1
  • 4
  • 11
19
votes
1 answer

Making a zip code choropleth in R using ggplot2 and ggmap

I am trying to make a choropleth of very simple data, and it's kind of a pain in the neck. I have the following zip codes in the Eastern USA. This is made up data but you get the idea. Zip Freq 11101 10 10014 15 11238 400 etc. for about…
garson
  • 1,505
  • 3
  • 22
  • 56
16
votes
1 answer

Optimising Shiny + Leaflet performance for detailed maps with many 'layers'

I want to make a Shiny app where the colouring of a choropleth is based on a numeric value of one of many possible quantitative variables that a user can select from. In simple cases, this is straightforward, but I'm unsure of the best practices…
dcl
  • 929
  • 1
  • 10
  • 22
16
votes
3 answers

Python: how to create a choropleth map out of a shapefile of Canada?

My goal here is to create a choropleth map of Canada in Python. Suppose I have a dictionary with values referring to each Canadian province/territory: myvalues={'Alberta': 1.0, 'British Columbia': 2.0, 'Manitoba': 3.0, 'New Brunswick': 4.0, …
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
15
votes
4 answers

Plot map with values for countries as color in R?

I have following simple example data which I want to plot on a map with gradient color corresponding to value of the given country. ddf = read.table(text=" country value USA 10 UK 30 Sweden 50 Japan 70 China 90 Germany 100 France 80 Italy 60 Nepal…
rnso
  • 23,686
  • 25
  • 112
  • 234
13
votes
1 answer

List of locationmode to use with plotly

I need to make a graphical representation of data distributed in Brazil, which is my country. I found that plotly can do this job, but when I went to research how to use plotly, every tutorial was using the locationmode attribute as 'USA-states'. Is…
Matheus Sant'ana
  • 563
  • 2
  • 6
  • 23
13
votes
2 answers

Drilldown in highmaps - how to remove a series

I am currently trying to create a drilldown map on Highmaps using this example: http://www.highcharts.com/maps/demo/map-drilldown I have got this to work with my own data for a different country correctly. The code from this example is: …
Maeve90
  • 345
  • 1
  • 6
  • 14
11
votes
2 answers

ggplot - Create a border overlay on top of map

So I am trying to create a Florida county-level map with borders based on a custom variable. I included an older version of the map that I am trying to create here Essentially, the map shows a region breakdown of Florida counties, with media…
Louie Quicksell
  • 161
  • 1
  • 3
  • 10
11
votes
2 answers

Choropleth maps for Germany

I am having Revenue data which I need to map on the German map. My data contains the postcodes, the corresponding latitude and longitude, as well as the value of revenue corresponding to that postcode, something like this - data = {'35447':…
cph_sto
  • 7,189
  • 12
  • 42
  • 78
10
votes
1 answer

Edit labels in tooltip for plotly maps using ggplot2 in r

I know this question has been asked a number of times but I think some of the underlying syntax for plotly has changed since those questions have been asked. Using ggplotly() to create a choropleth map gives the default tooltip of long, lat, group,…
Cyrus Mohammadian
  • 4,982
  • 6
  • 33
  • 62
10
votes
3 answers

reverse colors in colorNumeric()

I am trying to reverse the colors of a choropleth map. I am using the leaflet package and the colorNumeric() function, here is the code that generates the palette function: pal <- colorNumeric(palette = "YlGnBu", domain = foo$p) I would like to do…
Pierre Dudek
  • 252
  • 4
  • 11
9
votes
2 answers

adjust the size of the text label in plotly

Im trying to adjust the text size accoridng to country size, so the text will be inside the boardes of the copuntry. import pandas as pd import plotly.express as px df=pd.read_csv('regional-be-daily-latest.csv', header = 1) fig = px.choropleth(df,…
Greencolor
  • 501
  • 1
  • 5
  • 16
1
2 3
50 51