# GMT Question: Choropleth Map Does not Show Color

**URL:** <https://discourse.julialang.org/t/gmt-question-choropleth-map-does-not-show-color/95481>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [March 3, 2023, 4:53am UTC](https://discourse.julialang.org/t/gmt-question-choropleth-map-does-not-show-color/95481 "2023-03-03T04:53:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [March 3, 2023, 4:53am UTC](https://discourse.julialang.org/t/gmt-question-choropleth-map-does-not-show-color/95481/1 "2023-03-03T04:53:09Z")

</div>

Hi all,

I am trying tutorial from this:  
[https://www.generic-mapping-tools.org/GMT.jl/dev/gallery/choropleths/choropleth\_cv19/](https://www.generic-mapping-tools.org/GMT.jl/dev/gallery/choropleths/choropleth_cv19/)

First of all, it actually needs to have .shx file besides .shp files, but when I try to plot it the colors are missing. Why?

```julia
using GMT, DataFrames, CSV

Pt = gmtread("/home/browni/LasthrimProjection/testjulia185/concelhos.shp", no_islands=true);
incidence = CSV.read("/home/browni/LasthrimProjection/testjulia185/data_concelhos_incidencia.csv", DataFrame);

#Get the rate of incidence in number of infected per 100,000 habitants for the last reported week.

r = collect(incidence[end, 20:end]);
ids = names(incidence)[20:end];

# the names in dataconcelhosincidencia.csv and the concelhos.shp do not use the same case 
# (one is full upper case) so we need to use the nocase=truenocase=true below

zvals = polygonlevels(Pt, ids, r, att="NAME_2", nocase=true);

# Create a Colormap to paint the district polygons

C = makecpt(range=(0,1500,10), inverse=true, cmap=:oleron, hinge=240, bg=:o);

# Get the date for the data being represented to use in title
date = incidence[end,1];

plot(Pt, level=zvals, cmap=C, pen=0.5, 
	region=(-9.75,-5.9,36.9,42.1), 
	proj=:Mercator, 
	title="Infected / 100.000 habitants " * date)

colorbar!(pos=(anchor=:MR,length=(12,0.6), 
	offset=(-2.4,-4)), color=C, axes=(annot=100,), show=true)

```

 ![Capture d’écran_2023-03-03_11-52-34](https://global.discourse-cdn.com/julialang/original/3X/0/b/0bb1c4e236a67b3b918502256aba82254443ed81.png)

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [March 3, 2023, 2:10pm UTC](https://discourse.julialang.org/t/gmt-question-choropleth-map-does-not-show-color/95481/2 "2023-03-03T14:10:35Z")

</div>

Don’t use that link. Use the official manual [Choropleths](https://www.generic-mapping-tools.org/GMTjl_doc/examples/choropleths/choro_examples/) And that example is more complicated because we need to have the data used to create it. It’s there to show what-and-how we can do that type of choropleths. The other examples are simpler and you can download the data used in them.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [March 3, 2023, 2:12pm UTC](https://discourse.julialang.org/t/gmt-question-choropleth-map-does-not-show-color/95481/3 "2023-03-03T14:12:21Z")

</div>

Thanks for this, I didn’t know the link is not official one

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [March 3, 2023, 2:14pm UTC](https://discourse.julialang.org/t/gmt-question-choropleth-map-does-not-show-color/95481/4 "2023-03-03T14:14:41Z")

</div>

The official link is the one shown in the GMT.jl site

![image](https://global.discourse-cdn.com/julialang/original/3X/3/4/342dc59d7d27837da04384a1b70e0294dda3afd8.png)
