MCPcopy Index your code
hub / github.com/MarcCoru/locationencoder / draw_map

Function draw_map

utils/plot_results.py:153–173  ·  view source on GitHub ↗
(y, plot_points, title, bds=[-180,-90,180,90])

Source from the content-addressed store, hash-verified

151
152
153def draw_map(y, plot_points, title, bds=[-180,-90,180,90]):
154 fig = plt.figure()
155 map = Basemap(*bds)
156 ax = plt.gca()
157
158 # ax.scatter(points.theta.apply(np.rad2deg), points.phi.apply(np.rad2deg), c=points.land, s=2)
159 map.imshow(y.cpu().detach().numpy(), origin="lower", interpolation="none", cmap="RdBu_r", vmin=0, vmax=1)
160
161 if plot_points is not None:
162 map.scatter(plot_points[:,0], plot_points[:,1], c="red")
163
164 #map.drawcoastlines()
165 map.readshapefile("data/ne_50m_coastline/ne_50m_coastline", "coastlines")
166
167 ax.set_xlabel("longitude")
168 ax.set_ylabel("latitude")
169
170 if title is not None:
171 ax.set_title(title)
172
173 return fig
174
175
176def draw_globe(y, lonlats, plot_points, title):

Callers 1

plot_predictionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected