I need to scatter plot a dictionary of dictionary.
My data looks like this :
{'+C': {1: 191, 2: 557}, '+B': None, '-B': None, '+D': None, '+N': {1: 1, 3: 1}, '+L': {1: 2819, 2: 1506}, '>L': None, '<C': {0: 2125}, '<B': None, '<L': {0: 2949, 1: 2062}}
The outer keys are x axis labels and inside keys are y axis. The inside keys' values are annotations for x,y. I tried plotting the data but didn't get the graph I was looking for.
I tried the following but ended up having repetitions in my x axis.
for action, value in action_sequence.items():
if value:
for seq,count in value.items():
data["x"].append(action)
data["y"].append(seq)
data["label"].append(count)
else:
data["x"].append(action)
data["y"].append(-1)
data["label"].append(0)
print(data)
plt.figure(figsize=(10,8))
plt.title('Scatter Plot', fontsize=20)
plt.xlabel('x', fontsize=15)
plt.ylabel('y', fontsize=15)
plt.xticks(range(len(data["x"])), data["x"])
plt.scatter(range(len(data["x"])), data["y"], marker = 'o')