# GMT.jl Q&A

**URL:** https://forum.generic-mapping-tools.org/c/questions/gmt-jl-q-a/12.md

[Latest](https://forum.generic-mapping-tools.org/latest.md) · [Categories](https://forum.generic-mapping-tools.org/categories.md) · [Tags](https://forum.generic-mapping-tools.org/tags.md)

---

## [About the GMT.jl Q&A category](https://forum.generic-mapping-tools.org/t/about-the-gmt-jl-q-a-category/2030)

<div class="topic-metadata">

**Author:** [@maxrjones](https://forum.generic-mapping-tools.org/u/maxrjones)\
**Replies:** 1\
**Last updated:** [September 26, 2021, 12:09pm UTC](https://forum.generic-mapping-tools.org/t/about-the-gmt-jl-q-a-category/2030 "2021-09-26T12:09:56Z")

</div>

A place for questions about GMT.jl.

---

## [Gravity data preprocessing and plotting](https://forum.generic-mapping-tools.org/t/gravity-data-preprocessing-and-plotting/6190)

<div class="topic-metadata">

**Author:** [@geoexplo](https://forum.generic-mapping-tools.org/u/geoexplo)\
**Replies:** 3\
**Last updated:** [September 9, 2025, 2:50pm UTC](https://forum.generic-mapping-tools.org/t/gravity-data-preprocessing-and-plotting/6190 "2025-09-09T14:50:22Z")

</div>

Hello everyone. I have some gravity data with me. But the point is that I have never used GMT for gravity data. If anyone can drop a short tutorial on how to do it, I would really appreciate it Thanks in advance

---

## [UndefVarError: \`result\` not defined——gmt.jl](https://forum.generic-mapping-tools.org/t/undefvarerror-result-not-defined-gmt-jl/6150)

<div class="topic-metadata">

**Author:** [@brioglade](https://forum.generic-mapping-tools.org/u/brioglade)\
**Replies:** 1\
**Last updated:** [August 18, 2025, 3:36pm UTC](https://forum.generic-mapping-tools.org/t/undefvarerror-result-not-defined-gmt-jl/6150 "2025-08-18T15:36:17Z")

</div>

using GMT t = 0:0.01:2pi; plot(t, cos.(t).+rand(length(t))\*0.1, inset=(zoom=(pi/2,pi/6), box=(fill=:lightblue,)), show=true) $ “D:\\tmp3\\julia-1.10.9\\bin\\julia.exe” test.jl ERROR 1: Attempt to create 0x0 dataset is i…

---

## [How to extract component of a complex grid?](https://forum.generic-mapping-tools.org/t/how-to-extract-component-of-a-complex-grid/6073)

<div class="topic-metadata">

**Author:** [@TFJospin](https://forum.generic-mapping-tools.org/u/TFJospin)\
**Replies:** 3\
**Last updated:** [July 24, 2025, 10:26am UTC](https://forum.generic-mapping-tools.org/t/how-to-extract-component-of-a-complex-grid/6073 "2025-07-24T10:26:30Z")

</div>

How To read or write the real component of a complex grid in GMT ?.

---

## ["Residual" Grid Lines in Plot](https://forum.generic-mapping-tools.org/t/residual-grid-lines-in-plot/5846)

<div class="topic-metadata">

**Author:** [@Otto](https://forum.generic-mapping-tools.org/u/Otto)\
**Replies:** 5\
**Last updated:** [April 23, 2025, 11:15am UTC](https://forum.generic-mapping-tools.org/t/residual-grid-lines-in-plot/5846 "2025-04-23T11:15:03Z")

</div>

Hallo, I am pretty new to GMT.jl and started using the recently. I tried to plot a world map based on a data set with lon lat and z-values using the following code: # define grid grd1 = xyz2grd(df1, region=(-180, 180, -…

---

## [Grdimage not plotting entire dataset:](https://forum.generic-mapping-tools.org/t/grdimage-not-plotting-entire-dataset/5833)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://forum.generic-mapping-tools.org/u/GeodeticR)\
**Replies:** 15\
**Last updated:** [April 9, 2025, 2:01am UTC](https://forum.generic-mapping-tools.org/t/grdimage-not-plotting-entire-dataset/5833 "2025-04-09T02:01:28Z")

</div>

Hi All - I have been plotting .grd files and for some reason the highest latitude position in my file are either not being read or are just not plotting. I know that the data in the file are valid and are within the cpt …

---

## [Pcolor question](https://forum.generic-mapping-tools.org/t/pcolor-question/5790)

<div class="topic-metadata">

**Author:** [@alexvillarroel](https://forum.generic-mapping-tools.org/u/alexvillarroel)\
**Replies:** 2\
**Last updated:** [March 15, 2025, 7:59pm UTC](https://forum.generic-mapping-tools.org/t/pcolor-question/5790 "2025-03-15T19:59:14Z")

</div>

Hi, sorry if this is a silly question, does pcolor work on a specific projection? i only see examples on a cartesian proj but not for example on a mercator proj. thank you, i’m nobbie in julia

---

## [Colormap not showing up on map:](https://forum.generic-mapping-tools.org/t/colormap-not-showing-up-on-map/5772)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://forum.generic-mapping-tools.org/u/GeodeticR)\
**Replies:** 8\
**Last updated:** [March 7, 2025, 8:40pm UTC](https://forum.generic-mapping-tools.org/t/colormap-not-showing-up-on-map/5772 "2025-03-07T20:40:18Z")

</div>

Hi all, I’ve made progress with the map, but now the colormap won’t apply to there region. I’m not sure why. grdcut does not take cmap as an input, which leaves feeding my cpt into grdimage. I did make sure that the ep…

---

## [Trouble with clipping map to specific region:](https://forum.generic-mapping-tools.org/t/trouble-with-clipping-map-to-specific-region/5768)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://forum.generic-mapping-tools.org/u/GeodeticR)\
**Replies:** 2\
**Last updated:** [March 6, 2025, 9:56pm UTC](https://forum.generic-mapping-tools.org/t/trouble-with-clipping-map-to-specific-region/5768 "2025-03-06T21:56:06Z")

</div>

Hi all, I have a an interpolation in the form of a .grd file. These files cover all the the US and Canada up to Yellowknife. I’m trying create a map that only includes the data from the Pacific Northwest (Washington, O…

---

## [Making grid on map -- last minute help for AGU poster](https://forum.generic-mapping-tools.org/t/making-grid-on-map-last-minute-help-for-agu-poster/5605)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://forum.generic-mapping-tools.org/u/GeodeticR)\
**Replies:** 4\
**Last updated:** [December 8, 2024, 1:03am UTC](https://forum.generic-mapping-tools.org/t/making-grid-on-map-last-minute-help-for-agu-poster/5605 "2024-12-08T01:03:47Z")

</div>

Hi all; I have 3 more figure to make before I submit my AGU poster by 23:59 tonight EST. What I am trying to do is create a lines that will either fill with the corresponding color of the regions OR just have text tell…

---

## [Add vector that originates at lon/lat and that only point West or East:](https://forum.generic-mapping-tools.org/t/add-vector-that-originates-at-lon-lat-and-that-only-point-west-or-east/5565)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://forum.generic-mapping-tools.org/u/GeodeticR)\
**Replies:** 4\
**Last updated:** [December 2, 2024, 10:56am UTC](https://forum.generic-mapping-tools.org/t/add-vector-that-originates-at-lon-lat-and-that-only-point-west-or-east/5565 "2024-12-02T10:56:15Z")

</div>

Hi all; I am having trouble figuring out how to plot vectors that will only point either West or East, which the size of the arrow corresponds to the value I have. I have the longitude and latitude I want to plot them …

---

## [Code worked previously, and now it doesn't?](https://forum.generic-mapping-tools.org/t/code-worked-previously-and-now-it-doesnt/5569)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://forum.generic-mapping-tools.org/u/GeodeticR)\
**Replies:** 0\
**Last updated:** [November 27, 2024, 11:51pm UTC](https://forum.generic-mapping-tools.org/t/code-worked-previously-and-now-it-doesnt/5569 "2024-11-27T23:51:24Z")

</div>

I have used this exact code previously without issue, but now it is throwing an error and apparently it does not like this section of my code anymore? GMT.grdimage(G1, region = \[-130 -70 24 51\], proj = (name…

---

## [GMT.jl lelandshade() ignores transparency option when cpt is used](https://forum.generic-mapping-tools.org/t/gmt-jl-lelandshade-ignores-transparency-option-when-cpt-is-used/5397)

<div class="topic-metadata">

**Author:** [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Replies:** 5\
**Last updated:** [September 30, 2024, 12:04am UTC](https://forum.generic-mapping-tools.org/t/gmt-jl-lelandshade-ignores-transparency-option-when-cpt-is-used/5397 "2024-09-30T00:04:52Z")

</div>

When using lelandshade(), the transparency option works as expected without a cpt, as soon as I specify a cpt, it is always 100% traditional hill shading. What am I doing wrong? t.zip (115.0 KB) includes t.grd and t.cpt …

---

## [General Feedback and Critiques of Code and Plots:](https://forum.generic-mapping-tools.org/t/general-feedback-and-critiques-of-code-and-plots/5112)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://forum.generic-mapping-tools.org/u/GeodeticR)\
**Replies:** 16\
**Last updated:** [July 25, 2024, 12:31am UTC](https://forum.generic-mapping-tools.org/t/general-feedback-and-critiques-of-code-and-plots/5112 "2024-07-25T00:31:03Z")

</div>

Hi all, I am hoping that I could get some feedback both for my code and for the plots they’ve generated. If this isn’t the correct forum for this type of post, please let me know where a better suited place would be. F…

---

## [Frame all wonky with specified region in lambert conic projection (GMT.jl)](https://forum.generic-mapping-tools.org/t/frame-all-wonky-with-specified-region-in-lambert-conic-projection-gmt-jl/5079)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://forum.generic-mapping-tools.org/u/GeodeticR)\
**Replies:** 4\
**Last updated:** [July 12, 2024, 11:23pm UTC](https://forum.generic-mapping-tools.org/t/frame-all-wonky-with-specified-region-in-lambert-conic-projection-gmt-jl/5079 "2024-07-12T23:23:44Z")

</div>

Hi all, I’m not sure what I’m doing wrong here, and some guidance would be very much appreciated! For context, I created a map previously that looks like the first image below. I ran it by my advisor for feedback and t…

---

## [Xyz2grid latitude/longitude definitions & choosing the number of levels in grd2cpt](https://forum.generic-mapping-tools.org/t/xyz2grid-latitude-longitude-definitions-choosing-the-number-of-levels-in-grd2cpt/4931)

<div class="topic-metadata">

**Author:** [@Cornec\_H](https://forum.generic-mapping-tools.org/u/Cornec_H)\
**Replies:** 33\
**Last updated:** [May 31, 2024, 9:55pm UTC](https://forum.generic-mapping-tools.org/t/xyz2grid-latitude-longitude-definitions-choosing-the-number-of-levels-in-grd2cpt/4931 "2024-05-31T21:55:36Z")

</div>

Hey everyone! First off, thank you for all help, I really appreciate everyone who takes time off their own work to help others. My problem is the following: I am currently trying to create a series of maps for a presen…

---

## [GMT.jl: Quantile-weighted color bar & movie function](https://forum.generic-mapping-tools.org/t/gmt-jl-quantile-weighted-color-bar-movie-function/4896)

<div class="topic-metadata">

**Author:** [@Cornec\_H](https://forum.generic-mapping-tools.org/u/Cornec_H)\
**Replies:** 10\
**Last updated:** [May 17, 2024, 2:25pm UTC](https://forum.generic-mapping-tools.org/t/gmt-jl-quantile-weighted-color-bar-movie-function/4896 "2024-05-17T14:25:03Z")

</div>

Hey everyone, I am relatively new to Julia and very new to GMT and have run into a few problems that I have not been able to solve by reading the documentation. I have a 19,000 x 153 matrix that I am reading in from a …

---

## [Resolution tests to my Tomography maps](https://forum.generic-mapping-tools.org/t/resolution-tests-to-my-tomography-maps/2829)

<div class="topic-metadata">

**Author:** [@Boulanouar](https://forum.generic-mapping-tools.org/u/Boulanouar)\
**Replies:** 3\
**Last updated:** [April 23, 2024, 1:11pm UTC](https://forum.generic-mapping-tools.org/t/resolution-tests-to-my-tomography-maps/2829 "2024-04-23T13:11:35Z")

</div>

Hi, I created some 2D tomography maps using GMT software. And I need to do some resolution tests for these maps. Is there any way to it sing GMT? Regards BOULANOUAR

---

## [GMT.jl installation on Ubuntu 18](https://forum.generic-mapping-tools.org/t/gmt-jl-installation-on-ubuntu-18/4647)

<div class="topic-metadata">

**Author:** [@aqeel-magsi](https://forum.generic-mapping-tools.org/u/aqeel-magsi)\
**Replies:** 2\
**Last updated:** [January 28, 2024, 1:49pm UTC](https://forum.generic-mapping-tools.org/t/gmt-jl-installation-on-ubuntu-18/4647 "2024-01-28T13:49:30Z")

</div>

i am trying to install GMT.jl on my Ubunto but unable to solve it. Would you suggest any solution please? I did not find a suitable tutorial for installation: Below are the specifications: julia\> readlines(\`gmt --ver…

---

## [How to generate syntetic vehicle trajectories](https://forum.generic-mapping-tools.org/t/how-to-generate-syntetic-vehicle-trajectories/4633)

<div class="topic-metadata">

**Author:** [@benibilme](https://forum.generic-mapping-tools.org/u/benibilme)\
**Replies:** 4\
**Last updated:** [January 23, 2024, 8:26pm UTC](https://forum.generic-mapping-tools.org/t/how-to-generate-syntetic-vehicle-trajectories/4633 "2024-01-23T20:26:10Z")

</div>

Hello, I am trying to develop and test some algorithms on vehicle trajectories. I would like generate vehicle trajectories to test the algorithms and possibly display on GMT. I appreciate any insights directions. Than…

---

## [Problem of precompiling GMT.jl on windows machine](https://forum.generic-mapping-tools.org/t/problem-of-precompiling-gmt-jl-on-windows-machine/4541)

<div class="topic-metadata">

**Author:** [@hao](https://forum.generic-mapping-tools.org/u/hao)\
**Replies:** 5\
**Last updated:** [December 28, 2023, 12:19pm UTC](https://forum.generic-mapping-tools.org/t/problem-of-precompiling-gmt-jl-on-windows-machine/4541 "2023-12-28T12:19:34Z")

</div>

Hello, I am a new GMT.jl user and I am trying to add GMT.jl package on my windows machine. However, it keeps failing and I don’t know what’s the problem. Here is my command: julia\> Pkg.add(“GMT”) julia\> Pkg.build(“GMT…

---

## [How to plot selected contour lines?](https://forum.generic-mapping-tools.org/t/how-to-plot-selected-contour-lines/4357)

<div class="topic-metadata">

**Author:** [@leon6j](https://forum.generic-mapping-tools.org/u/leon6j)\
**Replies:** 0\
**Last updated:** [October 18, 2023, 8:49pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-selected-contour-lines/4357 "2023-10-18T20:49:57Z")

</div>

How do I add contour lines of a specific value, e.g., 1, to a filled contour? Thanks. Below is my current code: # Defining the coast: coast(region=(20,380,-90,90)); VAR\_grid = mat2grid(Array(transpose(VAR)),…

---

## [Mercator. How to draw a loxodrome line?](https://forum.generic-mapping-tools.org/t/mercator-how-to-draw-a-loxodrome-line/4069)

<div class="topic-metadata">

**Author:** [@george](https://forum.generic-mapping-tools.org/u/george)\
**Replies:** 2\
**Last updated:** [June 26, 2023, 3:39pm UTC](https://forum.generic-mapping-tools.org/t/mercator-how-to-draw-a-loxodrome-line/4069 "2023-06-26T15:39:47Z")

</div>

EZ question. I want to draw a Mercator and display a constant heading route (not a great circle). How?

---

## [GMT 6.4.0 startup hang under Mac OS X 10.13.6 (High Sierra)](https://forum.generic-mapping-tools.org/t/gmt-6-4-0-startup-hang-under-mac-os-x-10-13-6-high-sierra/3934)

<div class="topic-metadata">

**Author:** [@fgfletcher](https://forum.generic-mapping-tools.org/u/fgfletcher)\
**Replies:** 6\
**Last updated:** [May 14, 2023, 7:53pm UTC](https://forum.generic-mapping-tools.org/t/gmt-6-4-0-startup-hang-under-mac-os-x-10-13-6-high-sierra/3934 "2023-05-14T19:53:29Z")

</div>

Fresh download, hangs during startup under Mac OS X 10.13.6 with following diagnostic: Mm-i7-A:~ garth$ /bin/bash “/Applications/GMT-6.4.0.app/Contents/MacOS/GMT-6.4.0” GMT\_PROMPT dyld: Library not loaded: @executable\_…

---

## [Disable automatic plot display](https://forum.generic-mapping-tools.org/t/disable-automatic-plot-display/3772)

<div class="topic-metadata">

**Author:** [@Saballos](https://forum.generic-mapping-tools.org/u/Saballos)\
**Replies:** 11\
**Last updated:** [March 22, 2023, 5:11pm UTC](https://forum.generic-mapping-tools.org/t/disable-automatic-plot-display/3772 "2023-03-22T17:11:03Z")

</div>

Hello, How can I disable the automatic plot display in GMT 6.1 on a linux OS (e.g.Debian)? Best regards

---

## [Ray paths coverage disappear](https://forum.generic-mapping-tools.org/t/ray-paths-coverage-disappear/2876)

<div class="topic-metadata">

**Author:** [@Boulanouar](https://forum.generic-mapping-tools.org/u/Boulanouar)\
**Replies:** 5\
**Last updated:** [January 11, 2023, 11:05am UTC](https://forum.generic-mapping-tools.org/t/ray-paths-coverage-disappear/2876 "2023-01-11T11:05:59Z")

</div>

Hello, I creat a ray paths coverage using GMT script. The output file of my script is Ps file. When I convert the Ps format to the Pdf format or Jpg format the ray paths disapper. Please see the attachment files (one …

---

## [Transparency - Julia script on MacOS](https://forum.generic-mapping-tools.org/t/transparency-julia-script-on-macos/3532)

<div class="topic-metadata">

**Author:** [@timhume](https://forum.generic-mapping-tools.org/u/timhume)\
**Replies:** 1\
**Last updated:** [December 9, 2022, 11:23pm UTC](https://forum.generic-mapping-tools.org/t/transparency-julia-script-on-macos/3532 "2022-12-09T23:23:08Z")

</div>

Hi, I’m learning how to use Julia for GMT - I’m liking it a lot after having done all my GMT using shell scripts for the past thirty years or so! However, I cannot seem to get transparency to work. I am overlaying a co…

---

## [Xyz2grd with different min values](https://forum.generic-mapping-tools.org/t/xyz2grd-with-different-min-values/3497)

<div class="topic-metadata">

**Author:** [@heliozinhow](https://forum.generic-mapping-tools.org/u/heliozinhow)\
**Replies:** 3\
**Last updated:** [November 30, 2022, 7:47pm UTC](https://forum.generic-mapping-tools.org/t/xyz2grd-with-different-min-values/3497 "2022-11-30T19:47:43Z")

</div>

Hi there, I am not sure if I am missing something in my .grd creation but after running xyz2grd I am getting different values (min/max) from my original data. I was not expecting any kind of interpolation at this step. …

---

## [Grdrotater](https://forum.generic-mapping-tools.org/t/grdrotater/3486)

<div class="topic-metadata">

**Author:** [@David\_Hindle](https://forum.generic-mapping-tools.org/u/David_Hindle)\
**Replies:** 8\
**Last updated:** [November 27, 2022, 1:14pm UTC](https://forum.generic-mapping-tools.org/t/grdrotater/3486 "2022-11-27T13:14:05Z")

</div>

Hi. Hope I got the right subforum. Does grdrotater work with rasters (at all)? Beginning to suspect it does not. Trying gmt grdrotater @earth\_relief\_05m -V -E5/-20/2 -Foutline-wblock.txt -Grot\_er5m.grd -nc \> rot\_cl…

---

## [Extract grid value at x, y location](https://forum.generic-mapping-tools.org/t/extract-grid-value-at-x-y-location/3384)

<div class="topic-metadata">

**Author:** [@CompulsoryCoffee](https://forum.generic-mapping-tools.org/u/CompulsoryCoffee)\
**Replies:** 9\
**Last updated:** [November 7, 2022, 11:50am UTC](https://forum.generic-mapping-tools.org/t/extract-grid-value-at-x-y-location/3384 "2022-11-07T11:50:26Z")

</div>

Hi, I tried many things without success and I am keen to stop installing more libraries :slight\_smile: I loaded a grid G = gmtread("/GIS/g2015\_pga.tif") G 100×100×1 Raster{Float32,3} with dimensions: X Projected Li…

[Next page](https://forum.generic-mapping-tools.org/c/questions/gmt-jl-q-a/12.md?page=1)
