How to plot/scatter the content of vectors?

Hello

I am trying to add a plot into my project but I am facing problem figuring out how this is done.
In the code I have 3 vectors that change with each iteration. such as in this simple example

y1=[240.3];
y2=[516];
x=[0];

and as the iterations go on… new elements are added. so after 4 iteration for example, I would have:

y1=[240.3, 615, 409.2, 307];
y2=[516, 311.6, 982, 300];
x=[0, 1, 2, 3];

I have these vectors updating correctly but I don’t know how to use them to actually plot. I want to plot x with y1 and x with y2.
Something similar to this with legend

Thank you

Try using https://www.chartjs.org/

Thank you, this is helpful.
But now I keep getting this error

'Chart' is not defined  no-undef

@NoraKG Have you added this:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script>

sometimes downloading the file doesn’t work :slight_smile:

I don’t know why but this is not working.

Is it possible that adding a chart is different if the react library is used ?

@NoraKG Maybe look at this video