I have an array of global temperatures and associated longitude and latitude coordinates arrays. I would like to plot the temperatures as a heatmap on a map with custom projection and showing coastlines.
A working code example using matplotlib is:
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
f, ax = plt.subplots(subplot_kw={'projection': ccrs.Robinson()})
p = ax.pcolormesh(longitude, latitude, temperature, cmap='RdBu_r', transform=ccrs.PlateCarree())
ax.coastlines()
f.colorbar(p, orientation='horizontal')
The output figure from code block above is (data available here):

At the moment I was only able to use plotly for a simple heatmap with the following code:
from plotly.offline import iplot
import plotly.graph_objs as go
layout = go.Layout(geo={'projection': {'type': 'robinson'}})
data = go.Heatmap(x=longitude, y=latitude, z=temperature)
fig = go.Figure(data=[data], layout=layout)
iplot(fig)
As next figure shows, main issues are:
the projection is not working;
no coastlines are shown.

Would also love something similar!
You can plot both heatmap and contour plots on maps. Take a look here: https://plot.ly/~Dreamshot/9147 or visit this user (Dreamshot) Plotly profile for more examples.
Thanks! Will take a look :)
Although it does not seem to support mapping per se. I mean, the data are on a lat-lon coordinates, but what if we want to change the projection? I don't see a proper support for maps right out of the box (or at least without creating a unique map for each use case).
This blog should help: How to Create 2D and 3D Interactive Weather Maps in Python and R
A geographic heatmap figure factory would be really nice!