Assign values to data points in matplotlib

Viewed 13

I'm trying to create a binary map on a plt.plot. I have created a plot with a data point at every x,y coordinate but can't work out how to assign a binary value to each data point from a dataframe of indentical size/shape.

any help on this would be greatly appreciated!

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
#gd is a dataframe with binary values assigned for each i,j index
gd = pd.read_csv('SIG_Warehouse.csv',header=None)

x =[]
y =[]

for i in range(gd.shape[0]):
  for j in range(gd.shape[1]):
    x.append(i)
    y.append(j)


plt.scatter(x,y)
plt.show()
0 Answers
Related