Bug 56011 - mpltools.special.errorfill не работает с версией matplotlib >= 2.2.0 в репозитории
Summary: mpltools.special.errorfill не работает с версией matplotlib >= 2.2.0 в репози...
Status: NEW
Alias: None
Product: Branch p9
Classification: Distributions
Component: python-module-mpltools (show other bugs)
Version: не указана
Hardware: x86_64 Linux
: P5 normal
Assignee: real@altlinux.org
QA Contact: qa-p9@altlinux.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-16 13:20 MSK by Artem Varaksa
Modified: 2025-09-16 13:20 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Varaksa 2025-09-16 13:20:24 MSK
Upstream: https://github.com/tonysyu/mpltools/issues/32


Шаги
====

1. # apt-get install -y python-module-{numpy,matplotlib,mpltools}

2. $ cat > alt-mpltools-test.py << 'EOF'
#!/usr/bin/python
# coding=utf8

# https://tonysyu.github.io/mpltools/auto_examples/color/plot_cycle_cmap.html

import numpy as np
import matplotlib.pyplot as plt

from mpltools import layout
from mpltools import color


n_lines = 10

# Change default color cycle for all new axes
color.cycle_cmap(n_lines)

figsize = layout.figaspect(aspect_ratio=0.5)
fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=figsize)

# Change color cycle specifically for `ax2`
color.cycle_cmap(n_lines, cmap='pink', ax=ax2)

x = np.linspace(0, 10)
for shift in np.linspace(0, np.pi, n_lines):
    ax1.plot(x, np.sin(x - shift), linewidth=2)
    ax2.plot(x, np.sin(x - shift), linewidth=2)

plt.show()
EOF

3. $ python alt-mpltools-test.py

Фактический результат
=====================

> Traceback (most recent call last):
>   File "alt-mpltools-test.py", line 16, in <module>
>     color.cycle_cmap(n_lines)
>   File "/usr/lib/python2.7/site-packages/mpltools/color.py", line 215, in cycle_cmap
>     plt.rc('axes', color_cycle=color_cycle.tolist())
>   File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 303, in rc
>     matplotlib.rc(*args, **kwargs)
>   File "/usr/lib64/python2.7/site-packages/matplotlib/__init__.py", line 1265, in rc
>     'name "%s"') % (key, g, name))
> KeyError: 'Unrecognized key "axes.color_cycle" for group "axes" and name "color_cycle"'


Ожидаемый результат
===================

Отображение графика вида:
* https://tonysyu.github.io/mpltools/auto_examples/color/plot_cycle_cmap.html


Воспроизводимость
=================

Актуально для виртуальных машинах:

[p9]
python-module-mpltools-0.2.0-alt2.git20150224.1.1.noarch
python-module-matplotlib-2.2.3-alt6.x86_64

В более новых ветках и в sisyphus пакета нет.