Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Is basemap.rotate_vector working correctly?

Open
#294 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
numpy, python

Research direction

Start with the provided Python reproduction and the Basemap.rotate_vector entry point, using the lon=-84 and lat=45 vectors shown. Run the example and inspect the returned components and plotted arrows for the stated projection. Done means establishing whether the arrows should match and documenting or correcting the behavior with a regression check.

Written by the indexing model from the issue text.

Description

I have another indication that there might be something wrong in case of the rotpole projection, I'll try to make an example with that, later when I have some time. But for now please see the example below, should those to arrows be identical in this projection? (red is the rotated one and green is the original one) ...

figure_1


    import numpy as np
    from mpl_toolkits.basemap import Basemap
    import matplotlib.pyplot as plt

    u = np.array([0.5, ])
    v = np.array([0.5, ])

    lon = -84
    lat = 45

    lon = np.array([lon, ])
    lat = np.array([lat, ])

    b = Basemap(lon_0=0)

    urot, vrot = b.rotate_vector(u, v, lon, lat)
    xx, yy = b(lon, lat)


    b.quiver(xx, yy, urot, vrot, color="r")

    b.quiver(xx, yy, u, v, color="g")



    b.drawcoastlines()

Cheers

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

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.

More from matplotlib/basemap

All issues in matplotlib/basemap

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.