matplotlib / matplotlib/matplotlib

[MNT]: Clarify whether the values of an AxesImage are known as "data" or as "array"

Open
#28,929 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API: consistency Maintenance
Dominant language
Python
Stars
23.2k
Forks
8.5k
Avg merge
1d 6h
Merged PRs (30d)
66

Description

### Summary

The docstring of `AxesImage.set_array` says "Retained for backwards compatibility - use set_data instead.", but on the getter side, only `get_array` (inherited from ScalarMappable) exists -- `get_data` doesn't even exist.

### Proposed fix

Be consistent as to which name, "data" or "array", is used. I suspect they could even be made aliases of one another at the ScalarMappable level...
(Perhaps also distantly related to the colorizer-related API changes.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the AxesImage.set_array docstring with ScalarMappable.get_array, and review the possible relationship to the colorizer-related API changes mentioned in the issue. Done means the project has a decided, consistent naming scheme for these values and the relevant getter/setter behavior and documentation reflect that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data-visualization
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.