I am trying to produce a density plot from a loop. In each round of the loop my script reads a pair of x and y coordinates corresponding to 1 point; I would like to plot this point on-the-fly because then I need overwrite its values with the next pair of coordinates. Theoretically it seems possible to have a recursive way to create a heat map, but I could not find any.
matplotlib.pyplot.hexbin seems good, but if I try:
import matplotlib.pyplot as plt
import numpy
for n in range(10):
a= plt.hexbin(n,(numpy.random.random(1)))
I get
ValueError: First argument must be a sequence
It very seems hexbin does not accept values on the fly, but only array or lists already finalized.
histo2d would be another option, but seems to have the same limitation.
numpy.histogram2d as well.
[edit] responding to a comment, I simplified the question, I deleted the mention to oversized input as it is not useful for the purpose of the question.