Can you please elaborate on what real-time is in the context of your project?
You can certainly use a for() loop to generate this within one frame of the draw() cycle.
I combined these to generate data and plot it:
redraw() / Reference / Processing.org
thread() / Reference / Processing.org
An example that generates data in the background and updates sketch window every 1000ms:
int x, y;
void setup()
{
size(200, 200, P2D);
thread("requestData");
noLoop();
}
void draw()
{
fill(random(256));
circle(x, y, 20);
// You can write code here to plot data
}
// Runs in background thread and updates x and y every 1000ms
void requestData()
{
while(true)
{
x = random(width);
y = random(height);
delay(1000);
redraw();
}
}
I often simulate incoming data from other sources with the example above.
:)