I am using mpld3 to draw some plots in a browser. The scatter-plot is showing the correct colors, but the colorbar for the plot has the wrong labels. The colorbar is always labeled from 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"))
This looks like an mpld3 bug. Thanks for identifying it. I've opened an issue for it here. Patches welcome!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With