I try to do a scatterplot of lll
and bbb
variables with amplitudes
as color with a mollweide projection with a colorbar.
If I do
import pylab as plt
import numpy as np
lll=N.random.uniform(-180,180,10000)
bbb=N.random.uniform(-90,90,10000)
amp=N.random.uniform(0,1,10000)
fig = plt.figure(figsize=(12,9))
ax = fig.add_subplot(111, projection="mollweide")
ax.scatter(N.array(lll)*N.pi/180., N.array(bbb)*N.pi/180., c=amp)
ax.grid(True)
I get the plot I want but without the colorbar. If I add a line with ax.colorbar()
or plt.colorbar()
it don't work.
Thanks in advance for your help.