[MNT]: Consolidate axis sharing logic

Aberta
#32,520 2 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@tamrind69 já está trabalhando nisso.

Desde 30/10/2026.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
45/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
python

Direção de pesquisa

Read the Axes implementation and search for _sharex, _sharey, and Axes._shared_axes['x'] to locate the remaining uses and understand how sharing state is handled. Check whether any behavior depends on the parent-child relation, then remove the redundant state if the grouper can cover those uses. Done means axis sharing continues to work without _sharex/_sharey; the issue does not name tests, so identify and run the relevant sharing tests.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Maintenance
Summary

Sharing information is stored redundantly:

  • in the grouper class attribute Axes._shared_axes['x']. The grouper stores the shared axes in a list without a hierarchy.
  • in the _sharex attribute of Axes. This is asymmetic in that the only one of the Axes gets the _sharex attribute set, resulting in a parent-child relation.
Proposed fix

From https://github.com/matplotlib/matplotlib/issues/30159#issuecomment-3539310071

I think a reasonable incremental improvement would be to remove the Axes._sharex/y state. It's only used in very few places and can more reasonably be handled via the grouper Axes._shared_axes['x'].

Still to be clarified: Do we need the parent-child relation in any way? - From a quick look I don't think so.

Linguagem predominante
Python
Estrelas
23.5k
Forks
8.6k
Merge médio
1d 19h
PRs com merge (30d)
64

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de matplotlib/matplotlib

Todas as issues de matplotlib/matplotlib

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.