I am trying to call the gnuplot from c++. I am using wgnuplot for Windows and VS2005 c++.

The following statement works because it opens the gnuplot terminal

```
FILE *p = _popen("wgnuplot -persist","w");

```

But I cannot write anything there. My terminal is still blank even after running the following code.

```
fprintf(p, "set terminal x11 enhanced\n"); //set appropriate output terminal for the plot 
fprintf(p, "set xlabel 'N'\n");//set xlabel 
fprintf(p, "set ylabel 'error'\n");//set ylabel

```

Could you please tell me what might be the problem, i.e. why the terminal is blank and fprintf() doesn't seem to work?

Thanks,

Boris