From: Eric F. <ef...@ha...> - 2015-05-21 23:02:54
|
On 2015/05/21 11:28 AM, Matteo Niccoli wrote: > OK, I understand. > > > Could you suggest a way to reduce that 3D array to a 2D array and plot it > with a specific colormap, while preserving the shading? It looks like you will get what you want by following the titusjan's advice in his reply. If you are not seeing a shaded version of cubehelix, then the only thing I can imagine is that you inadvertently omitted the second line in his example: img_array = plt.get_cmap('cubehelix')(data_n) This is doing the colormapping at the start, generating the 3D array that you modify to apply your shading algorithm. Eric |