# PyGMT 0.6 / GMT 6.3.0 crashes when plotting polygons in combination with a date/time axes

**URL:** <https://forum.generic-mapping-tools.org/t/pygmt-0-6-gmt-6-3-0-crashes-when-plotting-polygons-in-combination-with-a-date-time-axes/2894>\
**Category:** PyGMT Q&A\
**Created:** [May 8, 2022, 12:55pm UTC](https://forum.generic-mapping-tools.org/t/pygmt-0-6-gmt-6-3-0-crashes-when-plotting-polygons-in-combination-with-a-date-time-axes/2894 "2022-05-08T12:55:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eelcodoornbos](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/eelcodoornbos/32/1744_2.png) [@eelcodoornbos](https://forum.generic-mapping-tools.org/u/eelcodoornbos)\
**Post date:** [May 8, 2022, 12:55pm UTC](https://forum.generic-mapping-tools.org/t/pygmt-0-6-gmt-6-3-0-crashes-when-plotting-polygons-in-combination-with-a-date-time-axes/2894/1 "2022-05-08T12:55:06Z")

</div>

Is it ok to post a PyGMT bug report here? The code below causes a crash on the plot command, when using PyGMT 0.6 and GMT 6.3.0. It worked/works as expected when using the older PyGMT 0.4 and GMT 6.2.0.

I’ve also tried the equivalent shell commands with GMT 6.3.0 (so without Python and by using an external file for providing the polygon coordinates), and this does still work ok, so I guess the issue was introduced in a recent version of PyGMT.

Here’s the basic code example:

```
import pygmt
fig = pygmt.Figure()
fig.basemap(region=["2021-01-01","2021-01-15",0,1], projection='X10cT/10c', frame=True)
fig.plot(x=["2021-01-01", "2021-01-05", "2021-01-10", "2021-01-15"], y=[0.75, 0.25, 0.4, 0.8], color='blue')
fig.show()

```

I get the following error messages:

```
Python(16886,0x1154ae600) malloc: *** error for object 0x6000006adde0: pointer being freed was not allocated
Python(16886,0x1154ae600) malloc: *** set a breakpoint in malloc_error_break to debug

```

Not sure if this plays a role (probably not), but I’ve installed PyGMT using pip (in pipenv) and GMT using the MacOS .dmg, after which I’ve ‘fixed’ the GMT library for use with PyGMT using the script in this issue: [https://github.com/GenericMappingTools/gmt/issues/1930](https://github.com/GenericMappingTools/gmt/issues/1930)

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [May 8, 2022, 2:29pm UTC](https://forum.generic-mapping-tools.org/t/pygmt-0-6-gmt-6-3-0-crashes-when-plotting-polygons-in-combination-with-a-date-time-axes/2894/2 "2022-05-08T14:29:21Z")

</div>

> [@eelcodoornbos](#):
>
> ```auto
> import pygmt
> fig = pygmt.Figure()
> fig.basemap(region=["2021-01-01","2021-01-15",0,1], projection='X10cT/10c', frame=True)
> fig.plot(x=["2021-01-01", "2021-01-05", "2021-01-10", "2021-01-15"], y=[0.75, 0.25, 0.4, 0.8], color='blue')
> fig.show()
> 
> ```

I can reproduce your issue with GMT 6.3.0, but it works well with the GMT dev version, so I think it’s a GMT bug which has been fixed recently.

---

<div class="post-metadata">

**Author:** ![eelcodoornbos](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/eelcodoornbos/32/1744_2.png) [@eelcodoornbos](https://forum.generic-mapping-tools.org/u/eelcodoornbos)\
**Post date:** [May 8, 2022, 9:11pm UTC](https://forum.generic-mapping-tools.org/t/pygmt-0-6-gmt-6-3-0-crashes-when-plotting-polygons-in-combination-with-a-date-time-axes/2894/3 "2022-05-08T21:11:56Z")

</div>

Thanks, that’s good news. I can probably get by by using a python environment with pyGMT 0.4 until the next GMT version comes out then.

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [May 9, 2022, 1:58am UTC](https://forum.generic-mapping-tools.org/t/pygmt-0-6-gmt-6-3-0-crashes-when-plotting-polygons-in-combination-with-a-date-time-axes/2894/4 "2022-05-09T01:58:04Z")

</div>

If you’re a conda user, you can install the GMT dev version using `conda install gmt -c conda-forge/label/dev`. Or if you’re a Homebrew users, you can use `brew install gmt --HEAD`.

---

<div class="post-metadata">

**Author:** ![eelcodoornbos](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/eelcodoornbos/32/1744_2.png) [@eelcodoornbos](https://forum.generic-mapping-tools.org/u/eelcodoornbos)\
**Post date:** [May 11, 2022, 3:28am UTC](https://forum.generic-mapping-tools.org/t/pygmt-0-6-gmt-6-3-0-crashes-when-plotting-polygons-in-combination-with-a-date-time-axes/2894/5 "2022-05-11T03:28:27Z")

</div>

Thanks again for these good suggestions. I’m using macports and pipenv at the moment, but I’ll keep this in mind.
