# The Leland texture illumination (again)

**URL:** <https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231>\
**Category:** Showcase\
**Created:** [September 8, 2023, 1:44pm UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231 "2023-09-08T13:44:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [September 8, 2023, 1:44pm UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/1 "2023-09-08T13:44:39Z")

</div>

Continuing [from](https://flint.soest.hawaii.edu/t/tweaking-illumination-shading/1511/58) and be patient because the texture shading calculation is not a fast thing.  
(see more at this GMT.jl [tutorial](https://www.generic-mapping-tools.org/GMTjl_doc/tutorials/texture_shading/texture/))

```auto
using GMT

G = gmtread("@earth_relief_01s", region=(-114.14,-111.28,35.50,37.06));
lelandshade(G, color=true, colorbar=true, fmt=:jpg, show=true)

```

 ![GMTjl_j](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/6/6bb12f8018d07bc0226fdff3563d32b025ba6073.jpeg)

---

<div class="post-metadata">

**Author:** ![79seismo](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/79seismo/32/507_2.png) [@79seismo](https://forum.generic-mapping-tools.org/u/79seismo)\
**Post date:** [September 8, 2023, 10:09pm UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/2 "2023-09-08T22:09:18Z")

</div>

Beautiful!

---

<div class="post-metadata">

**Author:** ![ghomsi123](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/ghomsi123/32/79_2.png) [@ghomsi123](https://forum.generic-mapping-tools.org/u/ghomsi123)\
**Post date:** [September 9, 2023, 9:37pm UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/3 "2023-09-09T21:37:06Z")

</div>

Amazing @Joaquim!  
I’m a Julia beginner… I wonder how to install lelandshade on Julia!

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [September 9, 2023, 9:56pm UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/4 "2023-09-09T21:56:58Z")

</div>

Good reminding. It’s still in GMT.jl master. I’ll commit some other changes and release a new version. Should be ready in one or two hours. (do a `] up` then and it should be ready to use).

---

<div class="post-metadata">

**Author:** ![ghomsi123](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/ghomsi123/32/79_2.png) [@ghomsi123](https://forum.generic-mapping-tools.org/u/ghomsi123)\
**Post date:** [September 9, 2023, 10:03pm UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/5 "2023-09-09T22:03:49Z")

</div>

Waiting for that!  
Amazing job!

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [September 9, 2023, 11:12pm UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/6 "2023-09-09T23:12:46Z")

</div>

GMT.jl 1.5.0 is now the current version. The above example should work, but given the recent [issue](https://github.com/GenericMappingTools/gmt/issues/7804) I don’t know if you don’t have to use another grid.

---

<div class="post-metadata">

**Author:** ![ghomsi123](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/ghomsi123/32/79_2.png) [@ghomsi123](https://forum.generic-mapping-tools.org/u/ghomsi123)\
**Post date:** [September 10, 2023, 8:02am UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/7 "2023-09-10T08:02:34Z")

</div>

It works perfectly!  
Now I’d like to use another colarbar instead of the topo one.  
Here’s what I’ve done, but I can’t get a promising result:

using GMT  
G = gmtread("@earth\_relief\_01s", region=(-11.8,-11.1,20.8,21.5));  
topo = makecpt(color=:batlowK, range=(270,630,20), continuous=true);  
lelandshade(G, color=topo, colorbar=true, fmt=:jpg, show=true)

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [September 10, 2023, 11:14am UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/8 "2023-09-10T11:14:55Z")

</div>

Sorry, a non tested case and a little bug. Will be fixed on master but meanwhile the workaround is to replace the default `cpt` in the G (GMTgrid) object. That is, do

```auto
G.cpt = "batlowK";

```

and repeat the `lelandshade(G, color=true, colorbar=true, fmt=:jpg, show=true)` command.

---

<div class="post-metadata">

**Author:** ![ghomsi123](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/ghomsi123/32/79_2.png) [@ghomsi123](https://forum.generic-mapping-tools.org/u/ghomsi123)\
**Post date:** [September 10, 2023, 12:07pm UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/9 "2023-09-10T12:07:46Z")

</div>

> [@Joaquim](#):
>
> `G.cpt = "batlowK";`

Interesting!  
By the way, if i’d like to save it, it seems that fname is not working.  
Also, if I’d like to add some faults on top of my topography and an inset map is it possible?  
Nice effort.

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [September 10, 2023, 12:27pm UTC](https://forum.generic-mapping-tools.org/t/the-leland-texture-illumination-again/4231/10 "2023-09-10T12:27:54Z")

</div>

The `name` is always a tricky guy in wrapper functions that call other modules inside. Although it would be nice that it works (and it will) with `show=true`, this options was more intended to for quick views. To do more complex maps don’t use `show` and it will return a GMTimage object (this is documented) that your can use in other modules. _e.g._

```auto
I = lelandshade(...)
grdimage(I, ...)
plot!(...)

```

or even

```auto
I = lelandshade(...)
viz(I, name=..., plot(data=...,))

```
