Analytics Vidhya
analyticsvidhya.com โบ home โบ cmap in python: tutorials & examples | colormaps in matplotlib (updated 2026)
Cmap in Python: Tutorials & Examples | Colormaps in Matplotlib (Updated 2026)
January 2, 2026 - First, you can combine two Sequential colormaps in matplotlib colormap. Second, you can choose and combine your favorite color in RGB to create colormaps. We will give you a demo of combining two Sequential colormaps to create a new colormap.
14:28
Matplotlib Colormap Tutorial (LinearSegmentedColormap) - YouTube
03:27
matplotlib Part 22 - Colormap Plots - YouTube
10:36
Custom Color Maps in Matplotlib - YouTube
09:48
Scatter plot with third variable as color | Python Matplotlib - ...
13:01
Matplotlib Plotting Tutorials : 038 : Matplotlib Colour maps in ...
19:09
A Better Default Colormap for Matplotlib | SciPy 2015 | Nathaniel ...
Which Matplotlib colormap should I use?
Use sequential for ordered magnitude, diverging for a meaningful midpoint, cyclic for wraparound values, and qualitative for unordered categories.
pythonpool.com
pythonpool.com โบ home โบ matplotlib โบ matplotlib cmap: sequential, diverging, cyclic, and qualitative
Matplotlib cmap: Sequential, Diverging, Cyclic, and Qualitative
How many colormaps does Matplotlib have?
Matplotlib 3.11 registers 182 colormap names. That is about 91 distinct maps plus a reversed _r twin of each; the gallery on this page lists 87 once British-spelling duplicates such as grey and gist_grey are removed. They are grouped into perceptually uniform sequential, sequential, sequential (2), diverging, cyclic, qualitative, and miscellaneous families.
docs.kanaries.net
docs.kanaries.net โบ topics โบ Matplotlib โบ examples-matplotlib-cmaps
Matplotlib Colormaps: Interactive Explorer and Complete Gallery ...
How do I reverse a colormap in Matplotlib?
Append _r to the name, for example cmap='viridis_r' or cmap='RdBu_r'. Every built-in colormap has a reversed twin. Programmatically you can also call plt.get_cmap('viridis').reversed().
docs.kanaries.net
docs.kanaries.net โบ topics โบ Matplotlib โบ examples-matplotlib-cmaps
Matplotlib Colormaps: Interactive Explorer and Complete Gallery ...
Kanaries
docs.kanaries.net โบ topics โบ Matplotlib โบ examples-matplotlib-cmaps
Matplotlib Colormaps: Interactive Explorer and Complete Gallery โ Kanaries
August 19, 2026 - Any plotting call that takes a c= or a 2D array also takes cmap=, and you set it by name: import matplotlib.pyplot as plt plt.imshow(data, cmap="viridis") # heatmaps, images, 2D arrays plt.scatter(x, y, c=values, cmap="plasma") # color encodes a third variable plt.colorbar() # always add this so the colors are readable
Seaborn
deeplearningnerds.com โบ matplotlib-color-maps
Matplotlib - Colormaps
December 15, 2023 - #plot 1 - magma plt.subplot(2, 3, 1) plt.scatter(x, y, c=colors, cmap='magma') plt.colorbar() plt.title('magma') #plot 2 - viridis plt.subplot(2, 3, 2) plt.scatter(x, y, c=colors, cmap='viridis') plt.colorbar() plt.title('viridis') #plot 3 - plasma plt.subplot(2, 3, 3) plt.scatter(x, y, c=colors, cmap='plasma') plt.colorbar() plt.title('plasma') #plot 4 - inferno plt.subplot(2, 3, 4) plt.scatter(x, y, c=colors, cmap='inferno') plt.colorbar() plt.title('inferno') #plot 5 - cividis plt.subplot(2, 3, 5) plt.scatter(x, y, c=colors, cmap='cividis') plt.colorbar() plt.title('cividis') plt.tight_layout() plt.show() Congratulations! Now you are one step closer to become an AI Expert. You have seen that it is very easy to use Colormaps provided by Matplotlib.
Matplotlib
matplotlib.org โบ stable โบ tutorials โบ colors โบ colormap-manipulation.html
Creating Colormaps in Matplotlib โ Matplotlib 3.7.2 documentation
May 1, 2020 - # my_cmap, my_cmap_r from reversing a colormap mpl.colormaps.register(cmap=my_cmap) mpl.colormaps.register(cmap=my_cmap_r) data = [[1, 2, 3, 4, 5]] fig, (ax1, ax2) = plt.subplots(nrows=2) ax1.imshow(data, cmap='my_cmap') ax2.imshow(data, cmap='my_cmap_r') plt.show()
Matplotlib
matplotlib.org โบ stable โบ users โบ explain โบ colors โบ colormap-manipulation.html
Creating Colormaps in Matplotlib โ Matplotlib 3.11.2 documentation
# my_cmap, my_cmap_r from reversing a colormap mpl.colormaps.register(cmap=my_cmap) mpl.colormaps.register(cmap=my_cmap_r) data = [[1, 2, 3, 4, 5]] fig, (ax1, ax2) = plt.subplots(nrows=2) ax1.imshow(data, cmap='my_cmap') ax2.imshow(data, cmap='my_cmap_r') plt.show()
Matplotlib
matplotlib.org โบ stable โบ users โบ explain โบ colors โบ colormaps.html
Choosing Colormaps in Matplotlib โ Matplotlib 3.11.2 documentation
# Default is 6 colormaps per subplot. dsub = _DSUBS.get(cmap_category, 6) nsubplots = int(np.ceil(len(cmap_list) / dsub)) # squeeze=False to handle similarly the case of a single subplot fig, axs = plt.subplots(nrows=nsubplots, squeeze=False, figsize=(7, 2.6*nsubplots)) for i, ax in enumerate(axs.flat): locs = [] # locations for text labels for j, cmap in enumerate(cmap_list[i*dsub:(i+1)*dsub]): # Get RGB values for colormap and convert the colormap in # CAM02-UCS colorspace.
TutorialsPoint
tutorialspoint.com โบ matplotlib โบ matplotlib_colormaps.htm
Matplotlib - ColorMaps
import matplotlib as mpl from matplotlib.colors import LinearSegmentedColormap import matplotlib.pyplot as plt import numpy as np # Creating a LinearSegmentedColormap from a list colors = ["rosybrown", "gold", "lawngreen", "linen"] cmap_from_list ...
Matplotlib
matplotlib.org โบ 3.1.1 โบ tutorials โบ colors โบ colormap-manipulation.html
Creating Colormaps in Matplotlib โ Matplotlib 3.1.2 documentation
top = cm.get_cmap('Oranges_r', 128) bottom = cm.get_cmap('Blues', 128) newcolors = np.vstack((top(np.linspace(0, 1, 128)), bottom(np.linspace(0, 1, 128)))) newcmp = ListedColormap(newcolors, name='OrangeBlue') plot_examples([viridis, newcmp])
Matplotlib
matplotlib.org โบ 3.1.0 โบ tutorials โบ colors โบ colormap-manipulation.html
Creating Colormaps in Matplotlib โ Matplotlib 3.1.0 documentation
May 18, 2019 - top = cm.get_cmap('Oranges_r', 128) bottom = cm.get_cmap('Blues', 128) newcolors = np.vstack((top(np.linspace(0, 1, 128)), bottom(np.linspace(0, 1, 128)))) newcmp = ListedColormap(newcolors, name='OrangeBlue') plot_examples([viridis, newcmp])
Python-Fiddle
python-fiddle.com โบ tutorials โบ matplotlib-colormaps
Understanding and Using Matplotlib Colormaps in Data Science
import numpy as np import matplotlib.pyplot as plt # Sample Data data = np.random.randn(30, 30) # Create a heatmap with a sequential colormap plt.imshow(data, cmap='Blues') plt.colorbar() # Adds a color scale legend plt.title('Sequential Colormap Example') plt.show()
Matplotlib
matplotlib.org โบ 3.1.0 โบ tutorials โบ colors โบ colormaps.html
Choosing Colormaps in Matplotlib โ Matplotlib 3.1.0 documentation
May 18, 2019 - Tutorials ยท Previous: Colormap Normalization ยท Next: Text in Matplotlib Plots ยท Show Page Source ยท Note ยท Click here to download the full example code ยท Matplotlib has a number of built-in colormaps accessible via matplotlib.cm.get_cmap. There are also external libraries like [palettable] and [colorcet] that have many extra colormaps.
GitHub
github.com โบ hhuangwx โบ cmaps
GitHub - hhuangwx/cmaps: user defined colormaps in matplotlib. ยท GitHub
import cmaps import numpy as np import inspect import matplotlib.pyplot as plt import matplotlib matplotlib.rc('text', usetex=False) def list_cmaps(): attributes = inspect.getmembers(cmaps, lambda _: not (inspect.isroutine(_))) colors = [_[0] for _ in attributes if not (_[0].startswith('__') and _[0].endswith('__'))] return colors if __name__ == '__main__': color = list_cmaps() a = np.outer(np.arange(0, 1, 0.001), np.ones(10)) plt.figure(figsize=(20, 20)) plt.subplots_adjust(top=0.95, bottom=0.05, left=0.01, right=0.99) ncmaps = len(color) nrows = 8 for i, k in enumerate(color): plt.subplot(nrows, ncmaps // nrows + 1, i + 1) plt.axis('off') plt.imshow(a, aspect='auto', cmap=getattr(cmaps, k), origin='lower') plt.title(k, rotation=90, fontsize=10) plt.title(k, fontsize=10) plt.savefig('colormaps.png', dpi=300) plt.close()
Matplotlib
matplotlib.org โบ 2.0.2 โบ examples โบ color โบ colormaps_reference.html
color example code: colormaps_reference.py โ Matplotlib 2.0.2 documentation
fig.text(x_text, y_text, name, va='center', ha='right', fontsize=10) # Turn off *all* ticks & spines, not just the ones with colormaps. for ax in axes: ax.set_axis_off() for cmap_category, cmap_list in cmaps: plot_color_gradients(cmap_category, cmap_list, nrows) plt.show()
Scaler
scaler.com โบ home โบ topics โบ matplotlib โบ colormaps in matplotlib
Adding colormaps in matplotlib - Scaler Topics
November 9, 2022 - There are two ways of adding colormaps to our plots in matplotlib: using the get_cmap() function and the colors attribute of the ListedColorMap object.
Purdue
docs.rcac.purdue.edu โบ workshops โบ matplotlib โบ colormaps
Colormaps - RCAC Documentation
April 9, 2026 - MatPlotLib has a great writeup ... as what each colormap looks like in greyscale. Using colormaps is quite simple: add the cmap='CMAP_NAME' option to the plotting function you are using and MatPlotLib will handle the rest....