Skip to content

DOC: Improve the basic tutorial "Plotting lines" - #4993

Open
Labu1 wants to merge 1 commit into
GenericMappingTools:mainfrom
Labu1:repodestek/issue-3747
Open

Labu1 wants to merge 1 commit into
GenericMappingTools:mainfrom
Labu1:repodestek/issue-3747

Conversation

@Labu1

@Labu1 Labu1 commented Nov 23, 2026

Copy link
Copy Markdown

Description of proposed changes

This PR improves the basic tutorial "Plotting lines" (examples/tutorials/basics/lines.py) following the suggestions in #3747, while keeping the scope suitable for a basic tutorial (as noted in the issue discussion):

  • Change line attributes: The four nearly identical figures (width only, width + color, width + style, width + color + style) are summarised into a single figure. Each line is annotated with the argument passed to pen, and the text explains the order of the width, color, style attributes and their defaults. The link to the "Line styles" gallery example is kept.
  • Connect points in different ways: The example now uses five data points (instead of two) so that the differences between the connection types are clearly visible, and it additionally covers the +s modifier of pen (Bezier cubic spline) next to the default linear spline and the two straight_line options ("x" and "y").
  • The sphinx_gallery_thumbnail_number is updated since the tutorial now has fewer figures.

More advanced content (e.g. sine/cosine curves) is left out to keep this a basic tutorial.

Fixes #3747

Preview:

Testing

Ran pytest in a clean Linux container: it did not pass (details on request).

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

This PR was prepared with AI assistance (Claude) and reviewed by me before submitting.

Combine the four separate figures in the "Change line attributes"
section into a single figure showing the pen width, color and style,
annotated with the corresponding pen arguments, to avoid repetition
with the "Line styles" gallery example.

Extend the "Connect points in different ways" section to use more
data points and to show the +s modifier of the pen parameter (Bezier
cubic spline) next to the linear spline and the stair-like
connections created via the straight_line parameter.

Fixes GenericMappingTools#3747.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve basic tutorial "Plotting lines"

1 participant