IndexError with Basemap.contour() when using certain projections

后端 未结 3 1536
挽巷
挽巷 2020-12-12 03:06

I have run into problems when using Basemap.contour with certain projections. Based on the example given in the Basemap documentation, I created the following w

3条回答
  •  一向
    一向 (楼主)
    2020-12-12 03:23

    This behavior is according to python3 integer division. Look for examples:

    1) python3:

    n=100
    print (n/2, (n+1)/2)
    

    Output: 50.0 50.5

    2) For python 2.7 this code returns 50 50

    Solutions:

    1) manually update contour and contourf function of basemap with division for python3.

    You have to write for integer n: n//2 which is apply division from python2.

    2) or run your program with python2.

提交回复
热议问题