matplotlib / matplotlib/mpl-probscale
Unexpected keyword argument 'basex' when following the Getting Started base-2 log scale example
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 40
- Forks
- 11
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
* Python version: Python 3.10.1 (v3.10.1:2cd268a3a9, Dec 6 2021, 14:28:59)
* Numpy Version: 1.21.5
* matplotlib version 3.5.1:
* mpl-probscale version: 0.2.3
* Operating System: macOS Moterrey Version 12.2.1
### Description
Working through the [_Getting Started_](https://matplotlib.org/mpl-probscale/tutorial/getting_started.html#built-in-matplotlib-scales) section, on the second example with base-2 log scales, I get the following error:
```
TypeError: LogScale.__init__() got an unexpected keyword argument 'basex'
```
Changing `basex` to `base` resolves the issue.
### What I Did
```
import numpy
from matplotlib import pyplot as plt
from scipy import stats
import seaborn
clear_bkgd = {'axes.facecolor': 'none', 'figure.facecolor': 'none'}
seaborn.set(style='ticks', context='talk', color_codes=True, rc=clear_bkgd)
fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(8, 3))
ax1.set_xscale('log')
ax1.set_xlim(left=1e-3, right=1e3)
ax1.set_xlabel("Base 10")
ax1.set_yticks([])
ax2.set_xscale('log', basex=2)
ax2.set_xlim(left=2**-3, right=2**3)
ax2.set_xlabel("Base 2")
ax2.set_yticks([])
seaborn.despine(fig=fig, left=True)
plt.show()
```
Traceback:
```
>>> Traceback (most recent call last):
File "", line 1, in
File "/Users/ricardo/Documents/Sandbox/Python/probscale_examples.py", line 17, in
ax2.set_xscale('log', basex=2)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 3777, in set_xscale
ax.xaxis._set_scale(value, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib/axis.py", line 761, in _set_scale
self._scale = mscale.scale_factory(value, self, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib/scale.py", line 597, in scale_factory
return scale_cls(axis, **kwargs)
TypeError: LogScale.__init__() got an unexpected keyword argument 'basex'
```
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Ouvrez la section Getting Started de l’exemple intégré de mise à l’échelle de Matplotlib indiqué par le lien et comparez l’exemple en base 2 avec l’erreur Matplotlib signalée. Mettez à jour le mot-clé obsolète et vérifiez que l’exemple s’exécute sans l’exception de mot-clé inattendu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- documentation
- Type d'issue
- Documentation
- Difficulté
- 1/5
- Temps estimé
- Moins d'une heure
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 35/100