# Histograms of .grd file

**URL:** <https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941>\
**Category:** Q&A\
**Created:** [October 12, 2020, 3:11am UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941 "2020-10-12T03:11:41Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![KRL](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/krl/32/583_2.png) [@KRL](https://forum.generic-mapping-tools.org/u/KRL)\
**Post date:** [October 18, 2020, 10:21pm UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/21 "2020-10-18T22:21:23Z")

</div>

okey, well yes I think i installed GMT6 using a bundle.

---

<div class="post-metadata">

**Author:** ![KRL](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/krl/32/583_2.png) [@KRL](https://forum.generic-mapping-tools.org/u/KRL)\
**Post date:** [October 18, 2020, 10:24pm UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/22 "2020-10-18T22:24:35Z")

</div>

Does this mean that GMT6 and GMT julia can be in the same OS?

---

<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:** [October 18, 2020, 10:53pm UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/23 "2020-10-18T22:53:04Z")

</div>

GMT.jl (the Julia wrapper) uses the installed GMT but it happens that the bundle is very _selfish_ and works well on its own only. When accessed from Julia, Matlab or Python the MacOS system manages to screw the dependencies and it doesn’t work. One need a native GMT build (like the one created by homebrew).

---

<div class="post-metadata">

**Author:** ![KRL](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/krl/32/583_2.png) [@KRL](https://forum.generic-mapping-tools.org/u/KRL)\
**Post date:** [October 19, 2020, 9:20pm UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/24 "2020-10-19T21:20:19Z")

</div>

Hi,  
I have instal GMT though brewer and had to compile one more however I still show issues trying to run the example. any new suggestions on what might be happening with the installation of GMT I think that it got installed GMT 6.1?

 ![Screen Shot 2020-10-19 at 17.16.54](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/3fa0d58697536e5df417e1fce434f709be3f185c.png)

---

<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:** [October 19, 2020, 11:39pm UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/25 "2020-10-19T23:39:39Z")

</div>

Hmm, it looks a GMT error, what happens if you run the tests `] test GMT`?  
and if you try to read the grid (the `gmtread("....` I showed above)?

---

<div class="post-metadata">

**Author:** ![KRL](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/krl/32/583_2.png) [@KRL](https://forum.generic-mapping-tools.org/u/KRL)\
**Post date:** [October 19, 2020, 11:51pm UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/26 "2020-10-19T23:51:16Z")

</div>

okey I will give it a go

---

<div class="post-metadata">

**Author:** ![KRL](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/krl/32/583_2.png) [@KRL](https://forum.generic-mapping-tools.org/u/KRL)\
**Post date:** [October 19, 2020, 11:56pm UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/27 "2020-10-19T23:56:25Z")

</div>

![Screen Shot 2020-10-19 at 19.53.42](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/46727f46eaf75cffe8b20d20e8e95d27477c08b1.png)

---

<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:** [October 20, 2020, 12:01am UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/28 "2020-10-20T00:01:15Z")

</div>

Don’t remember if there any problem with GMT.jl v0.22.0 but current version is 0.26.0. Try the latest, (`] up` ) though I start to suspect there was a problem at 6.1.1 time that I probably did not detect.

If I go to [https://github.com/GenericMappingTools/try-gmt](https://github.com/GenericMappingTools/try-gmt)  
my example works too.

Edit2: Installed GMT6.1.1 and thinks keep working fine with 0.26.0

---

<div class="post-metadata">

**Author:** ![KRL](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/krl/32/583_2.png) [@KRL](https://forum.generic-mapping-tools.org/u/KRL)\
**Post date:** [October 20, 2020, 2:59am UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/29 "2020-10-20T02:59:52Z")

</div>

Okey good news it is working ! I was able to generate the first example now the thing is that I have change

to this:

using GMT

# A test grid

#G = grdmath("-R300/900/0/600 -I10 X");  
G = gmtread("/Users/Keyla/2020-Venezuela/2020\_CUMANA\_MICRO/cumanaVs30\_Integrated.nc");

G[G .\> 700] .= 5;  
G[G .\> 600] .= 4;  
G[G .\> 500] .= 3;  
G[G .\> 400] .= 2;  
G[G .\>= 300] .= 1;

# Need to update z\_min & z\_max

G = grdedit(G);

gmtwrite("/Users/Keyla/2020-Venezuela/2020\_CUMANA\_MICRO/classe.grd", G)

imshow(G, view=(200,30), fmt=:png)

and is givinf the same figure of the first example. Also I was wondering if the new grd should this be in a new variable ? or it will replace the integrated grd?

---

<div class="post-metadata">

**Author:** ![KRL](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/krl/32/583_2.png) [@KRL](https://forum.generic-mapping-tools.org/u/KRL)\
**Post date:** [October 20, 2020, 3:18am UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/30 "2020-10-20T03:18:03Z")

</div>

![Screen Shot 2020-10-19 at 23.13.44](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/c0c2b73026d59d0ec365823a3a8589ac6935dc98.png) ![GMTjl_tmp](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/4cf851cab72f61d7d03fcfa499d6b46d1fe1a89b.png)

---

<div class="post-metadata">

**Author:** ![KRL](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/krl/32/583_2.png) [@KRL](https://forum.generic-mapping-tools.org/u/KRL)\
**Post date:** [October 20, 2020, 4:04am UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/31 "2020-10-20T04:04:08Z")

</div>

Okay I got this far, Now is there any like the GMT 6 documentation for GMT.jl? so I can integrate colour bar, smooth the pixel and try to present a Map?

 ![clasess](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/9856c9f2df9c011966752a501873cfb80e4eaaec.png)

---

<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:** [October 20, 2020, 11:36am UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/32 "2020-10-20T11:36:14Z")

</div>

> [@KRL](#):
>
> and is givinf the same figure of the first example. Also I was wondering if the new grd should this be in a new variable ? or it will replace the integrated grd?

Yes, probably because you didn’t save your changes to the `juliagmt.jl` script. I can see it from the screenshot.

---

<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:** [October 20, 2020, 11:46am UTC](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941/33 "2020-10-20T11:46:21Z")

</div>

> [@KRL](#):
>
> is there any like the GMT 6 documentation for GMT.jl?

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/4a105320f3fc7d0904f9915b577041427cde0516.png)

There are not manuals with the new syntax for all the modules but each has a quick online help by doing `? module_name` or, new in 0.26.0, `gmthelp("module_name"). Besides that, the GMT help is the main source of help. Remember that all options can be used with string arguments as for example in `R=“0/1/10/50”``

[Previous page](https://forum.generic-mapping-tools.org/t/histograms-of-grd-file/941.md?page=1)
