Skip to content

Feature Implementation for "setting spine default location displacement rcParams" - DRAFT PR #30011

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
126 changes: 0 additions & 126 deletions .gitignore

This file was deleted.

5 changes: 5 additions & 0 deletions lib/matplotlib/mpl-data/matplotlibrc
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@
#axes.spines.top: True
#axes.spines.right: True

#axes.spines.left.position: outward, 0.0 # set (outward, axes, data) position
#axes.spines.bottom.position: outward, 0.0
#axes.spines.top.position: outward, 0.0
#axes.spines.right.position: outward, 0.0

#axes.unicode_minus: True # use Unicode for the minus symbol rather than hyphen. See
# https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
#axes.prop_cycle: cycler(color='tab10')
Expand Down
5 changes: 5 additions & 0 deletions lib/matplotlib/mpl-data/stylelib/classic.mplstyle
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ axes.prop_cycle : cycler('color', 'bgrcmyk')
# as list of string colorspecs:
# single letter, long name, or
# web-style hex
axes.spines.bottom.position: outward, 0.0
axes.spines.left.position: outward, 0.0
axes.spines.right.position: outward, 0.0
axes.spines.top.position: outward, 0.0

axes.autolimit_mode : round_numbers
axes.xmargin : 0 # x margin. See `axes.Axes.margins`
axes.ymargin : 0 # y margin See `axes.Axes.margins`
Expand Down
5 changes: 5 additions & 0 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,11 @@ def _convert_validator_spec(key, conv):
"axes.spines.bottom": validate_bool, # denoting data boundary.
"axes.spines.top": validate_bool,

"axes.spines.left.position": validate_anylist,
"axes.spines.right.position": validate_anylist,
"axes.spines.bottom.position": validate_anylist,
"axes.spines.top.position": validate_anylist,

"axes.titlesize": validate_fontsize, # Axes title fontsize
"axes.titlelocation": ["left", "center", "right"], # Axes title alignment
"axes.titleweight": validate_fontweight, # Axes title font weight
Expand Down
8 changes: 6 additions & 2 deletions lib/matplotlib/spines.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,12 @@ def get_path(self):

def _ensure_position_is_set(self):
if self._position is None:
# default position
self._position = ('outward', 0.0) # in points
# default position in points
default_pos = mpl.rcParams[f'axes.spines.{self.spine_type}.position']
if len(default_pos) == 1:
self._position = default_pos[0]
else:
self._position = [default_pos[0], float(default_pos[1])]
self.set_position(self._position)

def register_axis(self, axis):
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ requires = [

[tool.meson-python.args]
install = ['--tags=data,python-runtime,runtime']
setup = ['--vsenv']

[tool.setuptools_scm]
version_scheme = "release-branch-semver"
Expand Down
Loading