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

added raise condition and grouped Tick constructor parameters#26037

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

Open
madeira-dev wants to merge5 commits intomatplotlib:main
base:main
Choose a base branch
Loading
frommadeira-dev:refact_kwargs_tick
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletionslib/matplotlib/axis.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@
import datetime
import functools
import logging
import warnings
from numbers import Real

import numpy as np
Expand DownExpand Up@@ -57,26 +58,12 @@
"""
def __init__(
self, axes, loc, *,
size=None, # points
width=None,
color=None,
tickdir=None,
pad=None,
labelsize=None,
labelcolor=None,
labelfontfamily=None,
zorder=None,
gridOn=None, # defaults to axes.grid depending on axes.grid.which
tick1On=True,
tick2On=True,
label1On=True,
label2On=False,
major=True,
labelrotation=0,
grid_color=None,
grid_linestyle=None,
grid_linewidth=None,
grid_alpha=None,
size=None, width=None, color=None, major=True, pad=None, zorder=None, # global
Copy link
Member

@timhoffmtimhoffmAug 4, 2023
edited
Loading

Choose a reason for hiding this comment

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

The size in points info must stay.

I'd have a slight preference to keep the one-parameter-per-line format and reorder in there:

# globalsize=None,  # pointswidth=None,...# tick propstickdir=None,...

But that's personal taste and not a blocker.

Copy link
Member

Choose a reason for hiding this comment

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

I agree about the size in points comment staying.

tickdir=None, tick1On=True, tick2On=True, # tick prop
labelsize=None, labelcolor=None, labelrotation=0, # label prop
labelfontfamily=None, label1On=True, label2On=False, # label prop
grid_color=None, grid_linestyle=None, grid_linewidth=None, # grid prop
grid_alpha=None, gridOn=None, # grid prop
**kwargs, # Other Line2D kwargs applied to gridlines.
):
"""
Expand DownExpand Up@@ -154,6 +141,13 @@
grid_alpha = mpl.rcParams["grid.alpha"]
grid_kw = {k[5:]: v for k, v in kwargs.items()}

remaining_kwargs = {
k: v for k, v in kwargs.items() if not k.startswith('grid_')}
if remaining_kwargs:
warnings.warn(

Check warning on line 147 in lib/matplotlib/axis.py

View check run for this annotation

Codecov/ codecov/patch

lib/matplotlib/axis.py#L147

Added line #L147 was not covered by tests
f"Invalid kwargs (not starting with 'grid_'):{remaining_kwargs.keys()}"
)

self.tick1line = mlines.Line2D(
[], [],
color=color, linestyle="none", zorder=zorder, visible=tick1On,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp