# Scatter Plot directly on freefem?

**URL:** https://community.freefem.org/t/scatter-plot-directly-on-freefem/2962
**Category:** General Discussion
**Created:** [February 12, 2024, 4:04pm UTC](https://community.freefem.org/t/scatter-plot-directly-on-freefem/2962 "2024-02-12T16:04:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![brrrr](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@brrrr](https://community.freefem.org/u/brrrr)
#### Post date: [February 12, 2024, 4:04pm UTC](https://community.freefem.org/t/scatter-plot-directly-on-freefem/2962/1 "2024-02-12T16:04:21Z")

</div>

Good evening,  
I would like to do a simple scatter plot from values I calculated thanks to freefem++.  
the plot fonction doesn’t seem to work …  
I tried to use it like this :  
plot([value00,value01…],[value10,value11…]);

Do i have to geet my values on an other programming language in order to plot them?  
Thank you for your time and help !

---

<div class="post-metadata">

### Author: ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)
#### Post date: [February 12, 2024, 4:45pm UTC](https://community.freefem.org/t/scatter-plot-directly-on-freefem/2962/2 "2024-02-12T16:45:46Z")

</div>

One thing that I liked about FF was the way you could do 2D and 3D plots without  
temp files. Other packages support that to some degree probably but in general viewers  
work on files. I found out that paraview has an “in-situ” mode or way to interact with  
live code but someone would need to write an FF interface. After investigating on  
message boards, I found someone at a national US lab had done something like that  
for R and thought it would be useful more generally.  
There seem to be features in FF that I don’t know about or don’t work on my current  
version but I’m doing that plotting now with “mjmdatascope” since I can use it with FF  
and R and my own c++ code. I guess if there is demand I could clean it up and “ship  
it.” While I use it its not really stable to say the least,

[https://github.com/mmarchywka/mjmdatascope](https://github.com/mmarchywka/mjmdatascope)

and you can see the “swarmalator” example of real time scatterplots but  
I don’t have that in a FF thing yet.

[https://discourse.paraview.org/t/does-or-can-paraview-support-streaming-input/13637](https://discourse.paraview.org/t/does-or-can-paraview-support-streaming-input/13637)

---

<div class="post-metadata">

### Author: ![anotherche](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/anotherche/32/1791_2.png) [@anotherche](https://community.freefem.org/u/anotherche)
#### Post date: [February 13, 2024, 7:43am UTC](https://community.freefem.org/t/scatter-plot-directly-on-freefem/2962/3 "2024-02-13T07:43:54Z")

</div>

@brrrr , Actually, the `plot` function allows you to produce scatter plots using the syntax in your example (although it plots a line, not a scatter plot, to be precise, and there is no way to change the type of line, its thickness or its color, or I don’t know how to).  
For your code to work, you need the pairs of variables in square brackets `[value00,value01]` to be arrays of `x` and `y` values that specify the `x(y)` graph. That is, `value00` is an array of `x` values and `value01` is an array of y values (same size as `value00`). If you need multiple scatter plots, use `plot([Xarray1,Yarray1] , [Xarray2,Yarray2], [Xarray3,Yarray3]...)`.
