From: Arnold M. <arn...@wu...> - 2004-12-03 23:08:03
|
Dear all, At the moment I'm heavily using the scatter plot (great!). But if I want = to add a color bar (with the command colorbar(), directly following the call to scatter) to explain the meaning of the colors of the patches, matplotlib = (0.64) refuses to make a colorbar with the following message: First define a mappable image (eg imshow, figimage, pcolor, scatter I checked how colorbar knows that the plot under consideration is a 'mapp= able image': it calls gci() . And indeed, if I do that by hand, after a plot w= ith scatter, I get the message that there is no mappable image. According to the doc's and the error message above, the patches plotted b= y scatter should count as a mappable image, but apparently, they don't. Is this a bug or a misunderstanding on my side? Regards, Arnold PS: at the moment I'm using a workaround, by making my own colorbar comma= nd: just stealing the code from the original routine, but without getting the colors and number ranges from the image itself (I have to define those by hand). |