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

Reprs on formatters and locaters #21898

Open
Labels
Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!New featuretopic: ticks axis labels
@story645

Description

@story645

As discussed in#21874, there aren't reprs on the locators and formatters. Reprs of the form where eval(repr) = call, something like

eval('AutoDateLocator(maxticks=8)')=AutoDateLocator(maxticks)

would mean reprs could be used in the documentation examples, which would help keep the labels in sync. This is useful for the new example#21874 &

I think it's a good first issue 'cause it's fairly standalone and rote if you know classes, only potential difficulty might be in storing the original args:

When I tryAutoDateLocator.__repr__ = lambda self: f'AutodateLocator(maxticks={self.maxticks})' thenrepr(AutoDateLocator(maxticks=8)) returns'AutodateLocator(maxticks={0: 8, 1: 8, 3: 8, 4: 8, 5: 8, 6: 8, 7: 8})', i.e. the class variablemaxticks. I don't know how to get the value passed in during the function call. But even if this is possible, I find defining all therepr rather verbose and a bit hacky as compared to a simpleeval.

Originally posted by@StefRe in#21874 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesGood first issueOpen a pull request against these issues if there are no active ones!New featuretopic: ticks axis labels

    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