matplotlib / matplotlib/pytest-mpl

Paramater `remove_text` in `mpl_image_compare` decorator does not remove axis labels

Abierto
#120 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
272
Forks
53
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

When choosing `remove_text=True` I would have assumed that the text for axis labels was removed along with the axis ticks and any titles. But it doesn't seem to do that.

The code uses `remove_ticks_and_titles` from matplotlib and that does not appear to remove the axis labels (See [matplotlib documentation](https://matplotlib.org/stable/_modules/matplotlib/testing/decorators.html)).

I'd propose updating the `remove_text` conditional as follows:

```python

if remove_text:
remove_ticks_and_titles(fig)
for ax in fig.get_axes():
ax.set_xlabel = ""
ax.set_ylabel = ""
```

If this seems reasonable, I can submit a PR.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Start by locating the mpl_image_compare decorator and its remove_text conditional, then inspect how the existing remove_ticks_and_titles call affects axis labels. Verify the behavior with an image-comparison test and consider the proposed label-removal behavior done when remove_text=True excludes axis labels as well as ticks and titles.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
testing
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.