Skip to content

Figure.fill_between cashes in case of decreasing x data #4997

Backlog

Description

@yvonnefroehlich

Description of the problem

Figure.fill_between crashes in case it is used with decreasing x data. Potentially an upstream bug.

Minimal Complete Verifiable Example

# Orientated on https://www.pygmt.org/dev/gallery/lines/fill_areas_between_curves.html

import numpy as np
import pygmt

# x = np.arange(-10, 10.2, 0.15)  # works
x = np.arange(10, -10.2, -0.15)  # fails - The kernel died, restarting...
y1 = np.sin(3 * x)
y2 = np.sin(x / 2)

fig = pygmt.Figure()
fig.basemap(region=[-10, 10, -3.5, 3.5], projection="X15c/5c", frame=True)

fig.fill_between(
    x=x,
    y=y1, y2=y2,
    fill="lightorange", fill2="lightgreen",
    pen="1p,tomato", pen2="1p,darkgreen",
)

fig.show()

Full error message

The kernel died, restarting...

System information

PyGMT information:
  version: 0.20.0.dev210
System information:
  python: 3.14.6 | packaged by conda-forge | (main, Jul 24 2026, 16:16:13) [MSC v.1944 64 bit (AMD64)]
  executable: C:\ProgramData\Anaconda3\envs\pygmt_env_dev_670\python.exe
  machine: Windows-10-10.0.19045-SP0
Dependency information:
  numpy: 2.5.2
  pandas: 3.0.5
  xarray: 2026.7.0
  packaging: 26.3
  contextily: 1.7.1
  geopandas: 1.1.4
  IPython: 9.16.1
  pyarrow: 25.0.0
  rioxarray: 0.23.0
  gdal: 3.13.2
  ghostscript: 10.07.1
GMT library information:
  version: 6.7.0
  padding: 2
  share dir: C:/Program Files (x86)/gmt6/share
  plugin dir: C:/ProgramData/Anaconda3/envs/pygmt_env_dev_670/Library/bin/gmt_plugins
  library path: C:/ProgramData/Anaconda3/envs/pygmt_env_dev_670/Library/bin/gmt.dll
  cores: 4
  grid layout: rows
  image layout: 
  binary version: 6.7.0

Activity

  1. added
    bug
    upstream
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugupstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions