# GMT.jl errors when trying to plot- problem with PNG?

**URL:** <https://discourse.julialang.org/t/gmt-jl-errors-when-trying-to-plot-problem-with-png/47860>\
**Category:** Geo\
**Tags:** plotting, bug, geo, gmt\
**Created:** [October 6, 2020, 2:51pm UTC](https://discourse.julialang.org/t/gmt-jl-errors-when-trying-to-plot-problem-with-png/47860 "2020-10-06T14:51:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mihalybaci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mihalybaci/32/13528_2.png) [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Post date:** [October 6, 2020, 2:51pm UTC](https://discourse.julialang.org/t/gmt-jl-errors-when-trying-to-plot-problem-with-png/47860/1 "2020-10-06T14:51:15Z")

</div>

For some reason, I cannot get GMT.jl to work. When I attempt to do the “Hello, World” example plot I get the following message:

```julia
Error: /undefined in PSL_movie_label_completion

 (skipping the stacktrace...)

ERROR: Something went wrong when calling the module. GMT error number = 78

```

The “Hello round world” plot also only fails on the `plot!` command with PNG formatting. I think this is a problem with GMT.jl because I was able to successfully run several of the GMT examples straight from the shell with no errors. I drilled down into the tests and found that I get the exact same error for lines 342 and 343 in `runtests.jl`, which are

```julia
	logo(GMTjulia=2, savefig="logo.PNG")
	logo(GMTjulia=2, savefig="logo.PNG", fmt=:PNG)

```

And line 489

```julia
	grdcontour(G, axis="a", fmt="png", color=cpt, pen="+c", X=1, Y=1, N=true, U=[])

```

and line 1224

```julia
grdcontour(G, axis="a", color=cpt, pen="+c", fmt=:png, savefig="lixo")

```

I don’t know nearly enough to diagnose the problem, but it is suspicious to me that they all use PNG format. This is with GMT.jl v0.25.0 on Ubuntu 20.04 with GMT v6.0.0 from the repos. I also compiled Julia from source (to avoid another issue) and the `versioninfo()` is

```julia
Julia Version 1.5.2
Commit 539f3ce943* (2020-09-23 23:17 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-10.0.1 (ORCJIT, haswell)
Environment:
  JULIA_NUM_THREADS = 8

```

Any thoughts?

---

<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:** [October 6, 2020, 4:09pm UTC](https://discourse.julialang.org/t/gmt-jl-errors-when-trying-to-plot-problem-with-png/47860/2 "2020-10-06T16:09:28Z")

</div>

Hi,  
For troubles like this the best is to use the issues in the GMT.jl github, or even better, the [GMT forum](https://forum.generic-mapping-tools.org/).

It’s not clear to me what is happening but things point to a `ghostscript` trouble.  
GMT produces only postscript, and when users ask for a different format (`png` here), the ps file is converted via a `ghostscript` call. The default ps file is always written in `/tmp/GMTjl_tmp.ps`. Does that file display correctly?

---

<div class="post-metadata">

**Author:** ![mihalybaci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mihalybaci/32/13528_2.png) [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Post date:** [October 6, 2020, 4:25pm UTC](https://discourse.julialang.org/t/gmt-jl-errors-when-trying-to-plot-problem-with-png/47860/3 "2020-10-06T16:25:53Z")

</div>

Okay, I will keep that in mind for the future, I just didn’t want to open a Github issue if in fact this problem turns out to be a problem only for me and my setup. The file `/tmp/GMTjl_tmp.ps` does exist, but my postscript reader (`evince`) cannot seem to open it and just spins. I do have several PDFs that saved from my tests with command line `gmt`, so that did appear to work.

---

<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:** [October 6, 2020, 4:32pm UTC](https://discourse.julialang.org/t/gmt-jl-errors-when-trying-to-plot-problem-with-png/47860/4 "2020-10-06T16:32:04Z")

</div>

Thanks, that’s a good thinking. As I said, the best is to post in the GMT forum and append the ps file. Command line GMT and GMT.jl all end up in the same machinery, so we need to look at the ps file to see if there is a problem.

---

<div class="post-metadata">

**Author:** ![mihalybaci](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mihalybaci/32/13528_2.png) [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Post date:** [October 6, 2020, 4:33pm UTC](https://discourse.julialang.org/t/gmt-jl-errors-when-trying-to-plot-problem-with-png/47860/5 "2020-10-06T16:33:43Z")

</div>

Will do, thanks.

[Moving thread to GMT Discourse [here](https://forum.generic-mapping-tools.org/t/gmt-jl-errors-when-trying-to-plot-problem-with-png/928)]
