Very nice example! It's a little too complex for me, though, with all Thanks a lot, you helped me to work around my problem, see code belowĪlso, for this sort of comparison, sometimes it is more efficient to useĪ single colorbar for multiple panels, as in this example: That correct? If so, all you need to do is use the same norm for bothĬalls to imshow-that is, define a norm, set the limits you want on it, Imshow with a different data set in the second subplot, but have theĬolor scale and colorbar be identical to those in the first subplot. It's not quite clear to me yet, but I assume you want to use a call to Matplotlib-users mailing List Signup and Options Experience the power of Track Changes, Inline ImageĮditing and ensure content is compliant with Accessibility Checking. 1.8ĮditLive Enterprise is the world's most technically advanced contentĪuthoring tool. Im = ax.imshow(dat, interpolation='nearest', cmap=cm.get_cmap('rainbow', 20))Ī 2nd colorbar with the same limit than in the first subfig, i.e. Is that correct? If so, all you need to do is use the same norm for both calls to imshow-that is, define a norm, set the limits you want on it, and supply it as a kwarg.Īlso, for this sort of comparison, sometimes it is more efficient to use a single colorbar for multiple panels, as in this example: It's not quite clear to me yet, but I assume you want to use a call to imshow with a different data set in the second subplot, but have the color scale and colorbar be identical to those in the first subplot. Iġ) how can I have a colorbar in each subplot?Ģ) how can I adjust the range limits for a colorbar, so that theīelow is code which could serve as a starting point, I hope it helps I'd like to compare two sets of data by using subplots and imshow().
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |