I draw something with a marine regplot. As far as I understand, he uses pyplot.scatterbehind the scenes. Therefore, I suggested that if I specify the color for the scatter chart as a sequence, I could just call plt.colorbar, but it does not work:
sns.regplot('mapped both', 'unique; repeated at least once', wt, ci=95, logx=True, truncate=True, line_kws={"linewidth": 1, "color": "seagreen"}, scatter_kws={'c':wt['Cis/Trans'], 'cmap':'summer', 's':75})
plt.colorbar()
Traceback (most recent call last):
File "<ipython-input-174-f2d61aff7c73>", line 2, in <module>
plt.colorbar()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 2152, in colorbar
raise RuntimeError('No mappable was found to use for colorbar '
RuntimeError: No mappable was found to use for colorbar creation. First define a mappable such as an image (with imshow) or a contour set (with contourf).
Why doesn't it work, and is there a way around it?
It would be nice for me to use dot size instead of color if there was an easy way to generate legend for dimensions
Phlya source
share