Skip to content

Fix removed Matplotlib colormap API usage - #1125

Closed
sean0407 wants to merge 1 commit into
mapillary:mainfrom
sean0407:codex/opensfm-1116-colormap-api-20261019
Closed

sean0407 wants to merge 1 commit into
mapillary:mainfrom
sean0407:codex/opensfm-1116-colormap-api-20261019

Conversation

@sean0407

Copy link
Copy Markdown

Summary

- cm.get_cmap(...)
+ pl.get_cmap(...)

Replace removed matplotlib.cm.get_cmap calls in the three OpenSfM plotting/import scripts with matplotlib.pyplot.get_cmap. This preserves named and default colormap behavior. Closes #1116.

Evidence

  • Before: In Matplotlib 3.11.2, hasattr(matplotlib.cm, "get_cmap") returned False.
  • After: A credential-free, network-denied smoke check imported all three changed scripts against minimal OpenSfM stubs; both depth_colormap paths and the plot_graph path completed. The named/default pyplot.get_cmap paths and ScalarMappable color conversion passed.
  • git diff --check, Python AST parsing of all three changed files, and patch_policy.py passed (3 files, 7 changed lines, no binary changes).

Merge Danger

Door: two-way

Blast Radius: narrow

Only colormap lookup calls in three scripts change; reverting restores the previous behavior.

@meta-cla

meta-cla Bot commented Oct 19, 2026

Copy link
Copy Markdown

Hi @sean0407!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@sean0407 sean0407 closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential compatibility issues with matplotlib.cm.get_cmap (Incompatible with Matplotlib 3.9.0)

1 participant