GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — basemap cookbook example produces incorrect result · Issue #170 · matplotlib/matplotlib

basemap cookbook example produces incorrect result #170

New issue
Copy link
New issue
Copy link
Closed
Closed
basemap cookbook example produces incorrect result#170
Copy link

Description

@ddale
ddale
opened on Jun 20, 2011
Issue body actions

Original report at SourceForge, opened Wed Oct 27 12:10:24 2010

I have tried using the first cookbook example for basemap from the scipy website and the oceans are incorrectly getting filled in. Attached is a script to reproduce the issue, and the output that I obtain. I am using basemap r8719 and matplotlib r8763.

SourceForge Comments

On Sun Jan 2 09:57:56 2011, jswhit wrote:

Yes, this is a bug (as noted in the KNOWN_BUGS file) that unfortunately has plagued me for years and probably has no solution. The only workaround is to slightly adjust the center of the plot (in your case changing lon_0 from 50 to 45 fixes it), or use drawlsmask instead of fillcontinents.

On Thu Nov 18 00:30:28 2010, robitaille wrote:

I don't use basemap much, so the bug doesn't really affect me, but it seemed strange that this occured on a pretty standard Earth view, not a specific zoom-in like the one mentioned in the "KNOWN_BUGS". The fact that it worked when the cookbook was written suggests a bug was maybe introduced in the mean time?

On Thu Nov 11 22:25:12 2010, weathergod wrote:

I believe this is a known issue. From the source code in a file called "KNOWN_BUGS":

  • The fillcontinents method doesn't always do the right thing. Matplotlib
    always tries to fill the inside of a polygon. Under certain situations,
    what is the inside of a coastline polygon can be ambiguous, and the
    outside may be filled instead of the inside. To trigger this,
    run the garp.py example with lon=-71,lat=-33 (Santiago, Chile).
    Workaround - mask the land areas with the drawlsmask method instead of
    filling the coastline polygons.

Not to say that it isn't a bug, but rather it is a very difficult one to definittively/completely eradicate. Could you try the drawlsmask method to see if that is sufficient for you?

On Wed Oct 27 12:12:54 2010, robitaille wrote:

The fig.add_axes() should be fig.add_subplot(1,1,1) but this does not make any difference.

SourceForge History

  • On Sun Jan 2 09:57:56 2011, by jswhit: resolution_id: 100
  • On Wed Oct 27 12:11:10 2010, by robitaille: File Added: 391380: test.png
  • On Wed Oct 27 12:10:27 2010, by robitaille: File Added: 391379: test_basemap.py

Activity

  1. pelson commented on Apr 16, 2012

    @pelson
    pelson
    on Apr 16, 2012
    Member
    More actions

    @jswhit (and others): Seems like this belongs in https://github.com/matplotlib/basemap rather than here. Suggest the issue is closed.

  2. jswhit commented on Apr 21, 2012

    @jswhit
    jswhit
    on Apr 21, 2012
    More actions

    This issue is largely fixed in github master. There are still cases when the the continent fill fails, but it is now much harder to trigger. I believe the case in the OP now works.

  3. jswhit
    closed this as completedon Apr 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.