matplotlib / matplotlib/matplotlib

[ENH]: Plot overlay

Ouverte
#30,953 24 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

New feature
Langage dominant
Python
Étoiles
23.2k
Forks
8.5k
Merge moyen
1 j 6 h
PR mergées (30 j)
66

Description

### Problem

One limiting factor of interactivity in Matplotlib is that we draw almost all visual elements via Artists onto the figure. This has poor performance for fast changing elements like crosshair cursors, because we always have to redraw the complete figure (or try to fiddle with blitting).

### Proposed solution

The fundamental solution idea here is to pull such elements out of the actual figure and instead overlay them on the not-changing figure image.

This is currently in a very early idea stage.

**What can be achieved with this**
Interactivity with fast changing elments such as:
- Zoom box (already implemented as a special case)
- Crosshair cursors (see also #30516).
- Tooltips
- Selectors

**What still won't be possible**
Dynamically changing plot properties like greying out data depending on a selector like https://docs.bokeh.org/en/latest/docs/examples/interaction/linking/linked_brushing.html.

**What would be needed**
- A concept of overlays. This could be:
a) GUI specific, e.g. we define a set of native primitives (lines, rectangles, maybe semantic ones like CrosshairCursor, similar to artists) that are drawn by the canvas on top of the actual figure image. This requires implementing of the primitives in all backends and will provide the fastest rendering.
b) Create the concept of an "overlay figure" that uses our exising rendering mechanisms to create a (mostly transparent) full image that is drawn on top of the existing figure image.

- Some mapping and event logic, so e.g. that the overlay can draw a line across a complete Axes, or get tooltip information for the current coordinate.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par lire les approches d’overlay proposées dans cette issue ainsi que l’issue associée sur le crosshair-cursor, #30516. Aucun fichier, test ou entry point n’est indiqué, et l’issue en est encore à un stade précoce d’idéation. Une contribution nécessiterait une conception d’overlay arrêtée, des exigences définies pour le mapping et les événements, ainsi qu’un périmètre d’implémentation clairement défini.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
matplotlib, python
Domaine
data-visualization
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Calme
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.