[Python 2.7.12]
[Matplotlib 1.5.1]
Every scan cycle my code produces a 'top' score. I want to plot the performance over time. I have simplified the code into the example below:
import matplotlib.pyplot as plt from matplotlib import lines import random count = 1 plt.axis([0, 1000, 0, 100]) plt.ion() while True: count += 1 a=random.randint(1, 50) plt.plot(count, a,'xb-') plt.pause(0.05) plt.show() My aim is to produce a line graph. The problem is whatever I set the line style to, it doesn't take effect. It only plots scatter type graphs. I am however able to change whether its a dot or an 'X' marker.
Or is the problem with the fact that the scores are 'plot and forget' so it has nothing to draw from?
EDIT: Plotting will be done in real-time

aandcountare scalars, so whenplotis called, it is plotting a single point, and callingplotmultiple times won't connect the dots, because it will generate a different line instance,