Plot Colormap Confusion Matrix - Heatmap

A color map confusion matrix (heat map) with various styles
122 Downloads
Updated 13 Nov 2022

A ColorMap(HeatMap)Style Confusion Matrix

This code is an alternative to the MATLAB functions plotconfusion and confusionchart.

How to Use?

[ConfMat,Accuracy] = CmapConfusionMatrix(Actual_Labels,Predicted_Labels,Cmap);   
  • ConfMat : Confusion Matrix
  • Accuracy : Accuracy of Classification
  • Actual_Labels : True Labels
  • Predicted_Labels : Output Labels
  • Cmap : Colormap Style
    • Colormap Name : Select from the table below

If no Cmap argument is provided, a popup window will appear asking you to select one of the listed colormaps, and if you ignore this step or try to choose default colormap, default option will be selected automatically.(like the below)

snip

HeatMap Styles

Colormap Name Color Scale
parula colormap_winter
turbo colormap_turbo
hsv colormap_hsv
hot colormap_hot
cool colormap_cool
spring colormap_spring
summer colormap_summer
autumn colormap_autumn
winter colormap_winter
gray colormap_gray
bone colormap_bone
copper colormap_copper
pink colormap_pink
jet colormap_jet

Output using summer ColorMap

colorconf


Mail

Cite As

Farhad Abedinzadeh (2024). Plot Colormap Confusion Matrix - Heatmap (https://github.com/farhadabedinzadeh/ColorHeatMap_ConfusionMatrix/releases/tag/v1.0), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2022b
Compatible with R2019b and later releases
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.