Hi all,
I want to know is it possible to plot map with color for different country by using Julia. like this:
Each color could represent certain cluster/grouping.
I see mapbox is expensive, we need to have credit cards just for registration. Some like me do not have such luxury.
A quick search (on my phone) in this discourse led me to
choropleth.jl
#=
Summary: A simple gist on creating a choropleth map of counties in the US.
NOTE: You must install this data set for this gist: https://www2.census.gov/geo/tiger/TIGER2017/COUNTY/tl_2017_us_county.zip
Copyright 2021 Jacob Zelko (aka TheCedarPrince)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This file has been truncated. show original
but there are also resources such as Makie, GMT, OpenStreeMapX, to name a few.
Perhaps you could try a few and post your code if you get stuck?
empet
July 10, 2022, 1:52pm
#4
If you want to plot a mapbox choropleth, you don’t have to pay for mapbox, when callling PotlyJS.choroplethmapox
.
See an example here https://discourse.julialang.org/t/valid-geojson-object-for-choroplethmapbox-trace/72592
1 Like
The problem is not to make the choropleth map (here’s another elaborated example in GMT.jl
The problem is on how to plot the country names without doing it one by one.
1 Like
Simply load a CSV with country centre coordinates as shown here .
Not that simple. Those simple cases could be automatically set by computing the country polygon’s centroids. The real problem comes from cases like (using the example fig)
Democratic Republic of Congo
Tunisia
Burundi
Djibouti
Lesotho
Well, if you have less than 10 country names then adjusting the position of the labels manually should be easy…