Risk Matrix plot

Viewed 33

I'am trying plot a risk matrix, I have two vectors(bin impact and bin probability), but I don't know how to plot, all the tutorials I've seen used a 2D matrix, but when I convert my data to this 2D matrix a very chaotic matrix is generated.

My code:

import seaborn as sns
import matplotlib.pyplot as plt

def risk_matrix(infos):
  impact = infos['Bin Impact'].values
  probability = infos['Bin Closeness Centrality'].values

  matrix = list(zip(impact, probability))

  ax = sns.heatmap(matrix)
  
risk_matrix(infos)

The variable matrix it's the type [(2, 0), (0, 0), (2, 0), (2, 0), (0, 0), (2, 0), (2, 0), (2, 0), ...].

Image of risk matrix:

https://i.stack.imgur.com/RBpR4.png

0 Answers
Related