Python Forum
Map plot does not align with quiver
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Map plot does not align with quiver
#1
My wind speed map does not match the quiver location
lats = nc.variables['latitude'][:]
lons = nc.variables['longitude'][:]
U=Data.eastward_wind[0]
V=Data.northward_wind[0]

plt.figure(constrained_layout=True)
plt.imshow(wspeed_var[0, 0, :, :], extent=[min(lons), max(lons), min(lats), max(lats)])
plt.quiver(lons[::2], lats[::2], U[::2, ::2], V[::2, ::2])
plt.ylabel('latitude')
plt.title('Global Wind Speed for for ' + datelabel.strftime('%Y-%b-%d %H:%M'))
The result I get is this:
https://ibb.co/JyB48kV

What I understand from the imshow result is that the map is generated from the top so because my lats list started with negative value it instead generated the value that should be at the bottom at the top instead. But why does the quiver is not affected by this?

Attached Files

Thumbnail(s)
   
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  quiver plot scaling help StillAnotherDave 1 1,699 Oct-26-2020, 09:17 AM
Last Post: StillAnotherDave
  Align columns bentley 4 3,064 Jan-13-2019, 03:59 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020