matplotlib / matplotlib/basemap

clabels plotting outside of projection limb

Open
#298 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
817
Forks
395
PR merge metrics
No merged PRs in 30d

Description

  • OS: Mac OS 10.11.4 (El Capitan)
  • Matplotlib version: 1.5.1
  • Basemap version: 1.0.7
  • Both installed via anaconda

This issue was originally created in the matplotlib repo, but it was discussed there (matplotlib/matplotlib#6436) and decided that it should be against basemap.

The issue is that when I plot data over a basemap, and the region plotted is a subset of the globe, calling matplotlib.pyplot.clabel will place some clabels outside of the projection limb. I'm assuming it's because pyplot will create all the clabels first, and then plot the appropriate subset of data.

To illustrate this issue, here's a Jupyter notebook. The plot of the masked data represents the plot I would have expected pyplot to produce in the first place. If I choose to plot a small subset of data, clabels should be place on all visible contours, regardless of what region I plot.

Note that matplotlib/basemap#290 did not fix the issue. I can confirm that even with the basemap master compiled myself, clabels still have that issue.

Contributor guide

No contributing guide indexed for this repository

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 with the linked Jupyter notebook and reproduce the contour-label placement using the reported Basemap and Matplotlib versions. Compare the unmasked plot with the masked-data result, then investigate Basemap's projection-limb handling around pyplot.clabel and review matplotlib/basemap#290. Done means labels appear only on visible contours for a projected subset of the globe.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.