From: Matteo N. <ma...@my...> - 2015-05-21 17:07:50
|
I posted a question on stackoverflow about creating with making my own shading effect (I want to use horizontal gradient for the shading). http://stackoverflow.com/questions/30310002/issue-creating-map-shading-in-matplotlib-imshow-by-setting-opacity-to-data-gradi Unfortunately I cannot share the data because I am using it for a manuscripts, but my notebook with full code listing and plots, here: http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/surface_shading.ipynb/%3Fdl%3D0 The shading using gradient is implemented in two ways as suggested in the answer. What I do not understand is why the last plot comes out with a rainbow-like colors, when I did specify cubehelix as colormap. hsv = cl.rgb_to_hsv(img_array[:, :, :3]) hsv[:, :, 2] = tdx_n rgb = cl.hsv_to_rgb(hsv) plt.imshow(rgb[4:-3,4:-3], cmap='cubehelix') plt.show() Am I doing something wrong or is this unexpected behavior; is there a workaround? Thanks Matteo |