can you tell me is it possible to make this gradient image in python for example with matplotlib contour plot (like the image of the centre of our galaxy?1
Asked
Active
Viewed 215 times
0
-
Are you looking for a colormap using custom colors ? – endive1783 Feb 14 '22 at 09:44
-
I only want to use black, whtie and red colors. – Artem Ulyashev Feb 16 '22 at 18:55
1 Answers
0
You can use a custom colormap using LinearSegmentedColormap
, see this answer
import matplotlib.pyplot as plt
import matplotlib.colors
cmap = matplotlib.colors.LinearSegmentedColormap.from_list("", ["black","red","white"])
plt.imshow(img, cmap = cmap)

endive1783
- 827
- 1
- 8
- 18