# Plotting MeshL solutions,

**URL:** https://community.freefem.org/t/plotting-meshl-solutions/2667
**Category:** General Discussion
**Created:** [August 28, 2023, 11:38pm UTC](https://community.freefem.org/t/plotting-meshl-solutions/2667 "2023-08-28T23:38:37Z")
**Posts on this page:** 1
**Page:** 1

<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: [August 28, 2023, 11:38pm UTC](https://community.freefem.org/t/plotting-meshl-solutions/2667/1 "2023-08-28T23:38:37Z")

</div>

I had a hard time figuring out how to do 1D plots in ff so I decided to  
make that an early addition to datascope.  
The plugin and edp are inhere,  
[ff\_dscope\_line.zip](https://community.freefem.org/uploads/short-url/e2zMII0LVLFUocYk2b5ckMfKBkF.zip) (23.7 KB)  
the code is a mess and the example not “minimal” but it illustrates the issue  
of an indefinite number of fespace solutions overplotted on each other.

Datascope produced this primitive but useful output,

 ![datascopeload3](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/5/5e0da6f759eeb73ff09e048e351aa66184face99.jpeg)

I did note during coding you guys made some clever use of numeric types  
and I had a hard time using “unsigned int” for an index.  
In any case, I think I can clean this up and get done what I wanted in  
1D and make it easy to monitor stuff now.

Is there some existing was to do 1D “oscilloscope” mode in ff 1D?  
Thanks.

```auto
cat load3line.edp 
load "msh3"
load "medit"
 load "mjm_dscope_freefem"

int nx=10;
int nx2=22;
int[int] lbe=[100,200]; // begin and end point labels 
meshL Th1=Sline(nx, [1.0*x],label=lbe);
meshL Th2=Sline(nx2, [.5+ .25*(x-.5)],label=lbe);
fespace Vh1(Th1,P1);
fespace Vh2(Th2,P1);
Vh1 u1x=x;
Vh1 u1=(x>.5)?1:0;
Vh2 u2x=x;
Vh2 u2;
matrix A=interpolate(Vh2,Vh1);
u2[]=A*u1[];
cout<<u1x[]<<endl;
cout<<u1[]<<endl;
cout<<" u2 "<<endl;
cout<<u2x[]<<endl;
cout<<u2[]<<endl;
// program will die before the que is sent lol. 
Vh1 a,b,c,d;
for(int ff=0; ff<100; ++ff)
{
real cc=1.0*ff/100.0;
for(int i=0; i<a[].n; ++i)
{
real x=4.0*i/a[].n;
a[][i]=cc*sin(x);
b[][i]=cc*sin(x*x);
c[][i]=cc*cos(x*x*x);
d[][i]=cc*cos(x*x*x*x);
} //i 
mjmdscopeL(Th1,"somestirng ",a,b,c,d); // warning do not forget () 

} // ff 

```
