Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Line2D dash pattern getter #17316

Open
@MaozGelbart

Description

@MaozGelbart

Bug report

Bug summary

Forlines.Line2D, there existsline.get_linestyle() which returns a short string representation of one of the four preconfigured line styles ("-"/"--"/":"/"-."). For the "dashed" ("--") style, which is returned wherever the linestyle input is a tuple (ordashes kwarg was used orset_dashes was called with tuple input), the exact dash pattern is not returned. There's noline.get_dashes().

On the contrary,collections.LineCollection([], linestyle=style).get_linestyle() returns the (scaled) dash pattern and not the preconfigured linestyle, which is more general and helpful.collection.get_dashes() is an alias forget_linestyle().

Is it possible to add a getter for the (unscaled) original dash pattern of a line2d instance?

Code for reproduction

#linestyle input to line2d can be queried but dash pattern is not exposedfrommatplotlibimportlinesline=lines.Line2D([],[],linestyle=(0,(2,2)))line.get_linestyle()# "--"#similar dashing input to lineCollectionfrommatplotlibimportcollectionscollection=collections.LineCollection([],linestyle=(0,(2,2)))collection.get_linestyle()# [(0.0, [3.0, 3.0])]

Actual outcome

'--'[(0.0, [3.0, 3.0])]

Expected outcome

Matplotlib version

  • Matplotlib version: 3.2.1

Many thanks for considering this!

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp