Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clabels plotting outside of projection limb #6436

Closed
mikecharles opened this issue May 16, 2016 · 6 comments
Closed

clabels plotting outside of projection limb #6436

mikecharles opened this issue May 16, 2016 · 6 comments

Comments

@mikecharles
Copy link

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

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.

@tacaswell
Copy link
Member

This should probably be reported against basemap.

I suspect it is not an order issue, the code that decides where to put labels may not be checking if they would be visible.

The code for this lives at https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/contour.py#L58
if you would like to take a crack at this!

@tacaswell tacaswell added this to the 2.1 (next point release) milestone May 16, 2016
@tacaswell tacaswell added the Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues label May 16, 2016
@WeatherGod
Copy link
Member

This might actually be fixed on basemap's master as of a few days ago.
On May 16, 2016 7:33 PM, "Thomas A Caswell" notifications@github.com
wrote:

This should probably be reported against basemap.

I suspect it is not an order issue, the code that decides where to put
labels may not be checking if they would be visible.

The code for this lives at
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/contour.py#L58
if you would like to take a crack at this!


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#6436 (comment)

@mikecharles
Copy link
Author

Thanks @WeatherGod, do you know what PR that was? If this was fixed, would the milestone be the next release instead of 2.1?

@WeatherGod
Copy link
Member

It would have been matplotlib/basemap#290

Keep in mind that basemap is on its own release "schedule" (I use the term extremely loosely here) separate from matplotlib. The next release will be version 1.1.0 -- keeping in mind that the last release was 4 years ago. Development has picked up in the past 6 months, but I have been hard-pressed to find time to actually do a release. So, I'd suggest working off of master for the time being.

@WeatherGod WeatherGod removed this from the 2.1 (next point release) milestone May 17, 2016
@WeatherGod WeatherGod removed the Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues label May 17, 2016
@WeatherGod
Copy link
Member

If you find that the clabels are still outside the projection limbs (quite possible, since I wasn't considering them at the time), do open a new issue over at basemap's issue tracker.

@mikecharles
Copy link
Author

Thanks @WeatherGod I've opened an issue against basemap, since the basemap master still doesn't fix the issue.

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

No branches or pull requests

3 participants