Wrong color labels using mpld3

I am using mpld3 to draw some graphs in the browser. The scatter plot shows the correct colors, but the color bar for the plot has the wrong labels. The colored bar is always labeled 0 to 1, although vmin and vmax are different. Any ideas?

f, a= plt.subplots(figsize=(10,10))
f.subplots_adjust(left=0.2, right=0.90, bottom=0.05, top=0.95,
  hspace=0.1, wspace=0.1)

im=a.scatter(xList,yList,s=40,vmin=-200,vmax=200,edgecolors='none',c=zList)
divider = make_axes_locatable(a)
cax = divider.append_axes("right", size="5%", pad=0.05)
cbar=plt.colorbar(im, cax=cax)
cbar.set_label('Magnetfeld [nt]', labelpad=10)

a.set_xlabel('Distanz [m]')
a.set_ylabel('Distanz [m]', labelpad=100)
a.set_title('korrigiertes Magnetfeld')
a.set_aspect('equal')

return render_template('upload=mobil.html',name=mpld3.fig_to_html(f,template_type="simple"))

      

+3


source to share


1 answer


This looks like a bug mpld3

. Thanks for identifying. I opened a problem for him here . Patches are welcome!



+1


source







All Articles