How to plot/scatter the content of vectors?


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


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

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=""></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