Skip to content

DOC/gallery example "Fill area between curves": Add example for non-co-registered curves#4697

Draft
yvonnefroehlich wants to merge 20 commits into
mainfrom
add-gallery-between-curve-non-co-res
Draft

DOC/gallery example "Fill area between curves": Add example for non-co-registered curves#4697
yvonnefroehlich wants to merge 20 commits into
mainfrom
add-gallery-between-curve-non-co-res

Conversation

@yvonnefroehlich

@yvonnefroehlich yvonnefroehlich commented Jun 24, 2026

Copy link
Copy Markdown
Member

Description of proposed changes

Extend the gallery example for Figure.fill_between to show the usage of non-co-registered curves.

Related to #4692 and #4698.

Preview: https://pygmt-dev--4697.org.readthedocs.build/en/4697/gallery/lines/fill_areas_between_curves.html

Guidelines

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

@yvonnefroehlich yvonnefroehlich added this to the 0.19.0 milestone Jun 24, 2026
@yvonnefroehlich yvonnefroehlich self-assigned this Jun 24, 2026
@yvonnefroehlich yvonnefroehlich added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog labels Jun 24, 2026
@yvonnefroehlich yvonnefroehlich marked this pull request as draft June 24, 2026 12:09
@yvonnefroehlich yvonnefroehlich changed the title WIP: DOC: Add example for non-co-registered curves DO/gallery example "Fill area between curves": Add example for non-co-registered curves Jun 24, 2026
@yvonnefroehlich yvonnefroehlich changed the title DO/gallery example "Fill area between curves": Add example for non-co-registered curves DOC/gallery example "Fill area between curves": Add example for non-co-registered curves Jun 24, 2026
@seisman

seisman commented Jun 24, 2026

Copy link
Copy Markdown
Member

Off-topic: It's likely gallery example https://www.pygmt.org/dev/gallery/images/cross_section.html can be simplified with the Figure.fill_between method.

@seisman

seisman commented Jun 25, 2026

Copy link
Copy Markdown
Member

What about combining the first and second examples into one example? So we have three examples showing how the y2 curves can be specified by

  1. passing a scalar value to y2
  2. passing a sequence to y2
  3. using x2 and y2

# Partly Segmentation fault problem (at least on Windows)
# x3 = np.sort((np.random.rand(20) - 0.5) * 20)
# Line limit still applies
x3 = np.array([-10, -8.21, -7.4, -6.63, -5.89, -4.18, -3.45, -2.69, -1.96, 0.26, 1.61, 2.23, 3.49, 4.0, 5.28, 6.79, 7.12, 8.25, 9.13, 10]) # noqa: E501

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorter line length

Suggested change
x3 = np.array([-10, -8.21, -7.4, -6.63, -5.89, -4.18, -3.45, -2.69, -1.96, 0.26, 1.61, 2.23, 3.49, 4.0, 5.28, 6.79, 7.12, 8.25, 9.13, 10]) # noqa: E501
x3 = np.array([-10, -8.2, -7.4, -6.6, -5.8, -4.1, -3.4, -2.6, -1.9, 0.2, 1.6, 2.2, 3.4, 4.0, 5.2, 6.7, 7.1, 8.2, 9.1, 10]) # noqa: E501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants