Python basemap only draws text or comments in the lower left

Python basemap only draws text or comments in the lower left … here is a solution to the problem.

Python basemap only draws text or comments in the lower left

The problem is that basemap/matplotlib always draws the given text in the bottom left corner….

I tried a lot but it didn’t work :

# Set up plot
fig, ax = plt.subplots(figsize=(15,15))

m1 = Basemap(projection='merc',
             llcrnrlat=8.3,
             urcrnrlat=53.9,
             llcrnrlon=94.0,
             urcrnrlon=147.6,
             lat_ts=0,
             resolution='c')

m1.fillcontinents(color='#191919',lake_color='#000000') # dark grey land, black lakes
m1.drawmapboundary(fill_color='#000000')                # black background
m1.drawcountries(linewidth=0.1, color="w")              # thin white line for country borders
m1.drawstates(linewidth=0.1, color="w")

# Plot the data
mxy = m1(new_results["Longitude"].tolist(), new_results["Latitude"].tolist())
m1.scatter(mxy[0], mxy[1], s=300,c=np.divide(new_results["SumVolume"],100000000), lw=0, alpha=1, zorder=5,cmap='Reds')
ax.annotate("blablabla", (121.597366,25.105497),color='green')

#colorbar
plt.colorbar(label=r'24H Trading-Volume in MillionK$')
plt.clim(1, 21)
plt.title("Cryptocurrency capital movement - Asia")

Plot:

enter image description here

Any questions?

    ax.annotate("blablabla", (121.597366,25.105497),color='green')

Didn’t work as I wanted to. The coordinates (121.597366,25.105497) are a point on the map. By the way, X or Y does not matter, he always writes in the lower left corner

Solution

Since my comment has been confirmed, I should conclude that the solution of the problem is about coordinate transformations. The new code for the question section is:

ax.annotate("blablabla", m1(121.597366,25.105497),color='green')

Related Problems and Solutions