[Doc]: `.set_linestyle()` tuple method is unclear · Issue #26784 · matplotlib/matplotlib · GitHub
Skip to content

[Doc]: .set_linestyle() tuple method is unclear #26784

Description

@pawjast

Documentation Link

https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch.set_linestyle

Problem

I looked up a method for setting plot's spine line style to a custom dash and my lazy eye caught what I highlighted in yellow:

image

I tried this and naturally I got an error:

image

Only after googling some example and reading the doc very carefully I noticed the correct way to change the line style:

image

Suggested improvement

I think the doc should be re-written so it's more explicit:

Alternatively a dash tuple of the following form can be provided:

(offset, (off_ink, on_ink))

Where:

  • offset: definition
  • on_ink/off_ink: definition

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions