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

DOC: scales - built in options and custom scale usefulness#29404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 1 commit intomatplotlib:mainfromrcomer:custom-scale
Jan 11, 2025

Conversation

rcomer
Copy link
Member

PR summary

Today I spent way too long trying to wrap my head around why someone might write a custom scale. I have updated the example with what I think I have understood. Also updated theset_[xy]scale docstring as it was missing some built-in options, and I think we can be clearer about what happens to**kwargs.

PR checklist

@rcomerrcomer added this to thev3.10.1 milestoneJan 5, 2025
@rcomerrcomer changed the titleDOC: scales - built in options and custom usefulnessDOC: scales - built in options and custom scale usefulnessJan 5, 2025
value : {"linear", "log", "symlog", "logit", ...} or `.ScaleBase`
The axis scale type to apply.
value : str or `.ScaleBase`
The axis scale type to apply. Supported string values are "linear", "log",
Copy link
Member

Choose a reason for hiding this comment

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

Can you somehow integrate a link tohttps://matplotlib.org/devdocs/api/scale_api.html (maybe directly to the table (?) by adding a rst label before the table). The strings alone give a rough idea, but the link would give the ability to read up un what they mean and which kwargs are supported. You then may or may not leave out the explicit bullet list of classes under kwargs. Alternatively, create a table/bullet list (str name: class) under the value attribute to make the connection here, but still link out for additional context.

rcomer reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I like the idea of just linking to the table (which I didn't know was there!) Having the information in one place means we don't have to worry about keeping two versions in sync.


If you do not need any of the above, then you probably don't need to use this
verbose method, and instead can use `~.scale.FuncScale` and the ``'function'``
option of `~.Axes.set_xscale` and `~.Axes.set_yscale`. See the last example in
Copy link
Member

Choose a reason for hiding this comment

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

Additional note: I think we should make the FuncScale case more prominent. Not only as "last example in ...". Either as a top level example in parallel to this example, or by making two subsections in this example.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I have no objection to this, but also not the bandwidth right now.

timhoffm reacted with thumbs up emoji
@@ -3,7 +3,9 @@

The mapping is implemented through `.Transform` subclasses.

The following scales are builtin:
The following scales are built-in:
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Merriam-Webster says this is hyphenated, though we seem to have both ways all over the docs...

Copy link
Member

Choose a reason for hiding this comment

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

ChatGPT says:

The correct spelling depends on how the term is used in a sentence:

  1. "Built-in" (with a hyphen) is anadjective. It is used to describe something that is an integral or permanent part of something else.

    • Example: "The phone has a built-in camera."
  2. "Builtin" (no hyphen) is not a standard English word, but it is sometimes used as a term inprogramming or technical contexts, especially in filenames, identifiers, or codebases. For instance, Python has "builtin functions," though even here, "built-in" is more widely accepted in official documentation.

To summarize:

  • For general usage, "built-in" with a hyphen is correct.
  • For programming or technical contexts, check the convention of the specific language or framework being used.

rcomer reacted with eyes emoji
@timhoffmtimhoffm merged commit445f0d0 intomatplotlib:mainJan 11, 2025
37 of 39 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestJan 11, 2025
@rcomerrcomer deleted the custom-scale branchJanuary 11, 2025 23:27
timhoffm added a commit that referenced this pull requestJan 12, 2025
…404-on-v3.10.xBackport PR#29404 on branch v3.10.x (DOC: scales - built in options and custom scale usefulness)
@ksundenksunden mentioned this pull requestMar 3, 2025
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.10.1
Development

Successfully merging this pull request may close these issues.

2 participants
@rcomer@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp