Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #3103 > unrolled thread
| Started by | Marcello Chiurazzi <chiurazzi.marcello@gmail.com> |
|---|---|
| First post | 2015-10-11 03:11 -0700 |
| Last post | 2015-10-13 00:42 -0700 |
| Articles | 6 — 3 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
line 0: warning: Skipping data file with no valid points(gnuplot) Marcello Chiurazzi <chiurazzi.marcello@gmail.com> - 2015-10-11 03:11 -0700
Re: line 0: warning: Skipping data file with no valid points(gnuplot) Karl-Friedrich Ratzsch <mail.kfr@gmx.net> - 2015-10-11 13:01 +0200
Re: line 0: warning: Skipping data file with no valid points(gnuplot) Marcello Chiurazzi <chiurazzi.marcello@gmail.com> - 2015-10-12 15:38 -0700
Re: line 0: warning: Skipping data file with no valid points(gnuplot) Ethan A Merritt <sfeam@users.sourceforge.net> - 2015-10-12 16:30 -0700
Re: line 0: warning: Skipping data file with no valid points(gnuplot) Marcello Chiurazzi <chiurazzi.marcello@gmail.com> - 2015-10-13 00:33 -0700
Re: line 0: warning: Skipping data file with no valid points(gnuplot) Marcello Chiurazzi <chiurazzi.marcello@gmail.com> - 2015-10-13 00:42 -0700
| From | Marcello Chiurazzi <chiurazzi.marcello@gmail.com> |
|---|---|
| Date | 2015-10-11 03:11 -0700 |
| Subject | line 0: warning: Skipping data file with no valid points(gnuplot) |
| Message-ID | <00007e50-135d-46d6-b1fc-7d088a4c09e0@googlegroups.com> |
I have a problem using gnupolot from a c++ source code.
The error is this:line 0: warning: Skipping data file with no valid points
The code is this:
char * commandsForGnuplot[] = {"set title \"ThumbRest\"","plot [0:6][-8.0:8.0] 'Thumb_R_1' with linespoints lc rgb 'black', 'Thumb_R_2' with linespoints lc rgb 'green', 'Thumb_R_3' with linespoints lc rgb 'blue', 'Thumb_R_4' with linespoints lc rgb 'red'"};
for (int l=0;l<NUM_POINTS;l++)
{
xvals[l]=((6)*(l+1))/(double)NUM_POINTS;
}
FILE * temp1 = fopen("Thumb_R_1", "w");
FILE * temp2 = fopen("Thumb_R_2", "w");
FILE * temp3 = fopen("Thumb_R_3", "w");
FILE * temp4 = fopen("Thumb_R_4", "w");
/*Opens an interface that one can use to send commands as if they were typing into the
* gnuplot command line. "The -persistent" keeps the plot open even after your
* C program terminates.
*/
FILE * gnuplotPipe = popen ("gnuplot -persistent", "w");
int i;
for (i=0; i < NUM_POINTS; i++)
{
fprintf(temp1, "%g %g \n", xvals[i] , position_4f[4*i]); //Write the data to a temporary file
fprintf(temp2, "%g %g \n", xvals[i] , position_4f[1+4*i]); //Write the data to a temporary file
fprintf(temp3, "%g %g \n", xvals[i] , position_4f[2+4*i]); //Write the data to a temporary file
fprintf(temp4, "%g %g \n", xvals[i] , position_4f[3+4*i]); //Write the data to a temporary file
}
for (i=0; i < NUM_COMMANDS; i++)
{
fprintf(gnuplotPipe, "%s \n", commandsForGnuplot[i]); //Send commands to gnuplot one by one.
}
The plot is a traiectory followed by a robot,this traiectory is randomic because i set the pose to reach and the system define the traiectory,so the error is randomic too(sometimes i have it,sometimes no).
I would like to understand what is this error(warning).
[toc] | [next] | [standalone]
| From | Karl-Friedrich Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2015-10-11 13:01 +0200 |
| Message-ID | <mvdfj0$eum$1@solani.org> |
| In reply to | #3103 |
Am 11.10.2015 um 12:11 schrieb Marcello Chiurazzi:
> I have a problem using gnupolot from a c++ source code.
> The error is this:line 0: warning: Skipping data file with no valid points
>
> The code is this:
> char * commandsForGnuplot[] = {"set title \"ThumbRest\"","plot [0:6][-8.0:8.0] 'Thumb_R_1' with linespoints lc rgb 'black', 'Thumb_R_2' with linespoints lc rgb 'green', 'Thumb_R_3' with linespoints lc rgb 'blue', 'Thumb_R_4' with linespoints lc rgb 'red'"};
The warning means that one of your temporary data files has nothing
to do for "plot [0:6][-8.0:8.0]". Why, I cannot tell.
It's very hard to see the source of the problem with everything
wrapped in your C code. It could be a bug in gnuplot, an error in
the commands you use, an error in your data processing, a problem
with your original data, or anything else.
You should test your gnuplot commands in a plain gnuplot script, and
only then transfer them to your C code. Check if your temp files
really contain what you think they should, etc.
Karl
[toc] | [prev] | [next] | [standalone]
| From | Marcello Chiurazzi <chiurazzi.marcello@gmail.com> |
|---|---|
| Date | 2015-10-12 15:38 -0700 |
| Message-ID | <006694b0-b73d-4142-a3c9-20a2ce85840a@googlegroups.com> |
| In reply to | #3104 |
I do an example:
This is the code without problems:
int main(int argc, char **argv)
{
const char * commandsForGnuplot[] = {"set title \"A\"","plot [0:3][0:10] 'data1.temp' with linespoints lc rgb 'red'"};
double x1vals[NUM_POINTS] = {0.2 , 0.4 , 0.6 , 0.8, 1.0};
double y1vals[NUM_POINTS] = {1.0 , 1.0 , 1.0 , 1.0 , 1.0};
FILE * temp1 = fopen("data1.temp", "w");
/*Opens an interface that one can use to send commands as if they were typing into the
* gnuplot command line. "The -persistent" keeps the plot open even after your
* C program terminates.
*/
FILE * gnuplotPipe = popen ("gnuplot -persistent", "w");
int i;
for (i=0; i < NUM_POINTS; i++)
{
fprintf(temp1, "%lf %lf \n", x1vals[i] , y1vals[i]); //Write the data to a temporary file
}
for (i=0; i < NUM_COMMANDS; i++)
{
fprintf(gnuplotPipe, "%s \n", commandsForGnuplot[i]); //Send commands to gnuplot one by one.
}
return 0;
}
If i add a line to plot immediately the points instead of wait for the end of the execution i have this warning:
int main(int argc, char **argv)
{
const char * commandsForGnuplot[] = {"set title \"A\"","plot [0:3][0:10] 'data1.temp' with linespoints lc rgb 'red'"};
double x1vals[NUM_POINTS] = {0.2 , 0.4 , 0.6 , 0.8, 1.0};
double y1vals[NUM_POINTS] = {1.0 , 1.0 , 1.0 , 1.0 , 1.0};
FILE * temp1 = fopen("data1.temp", "w");
/*Opens an interface that one can use to send commands as if they were typing into the
* gnuplot command line. "The -persistent" keeps the plot open even after your
* C program terminates.
*/
FILE * gnuplotPipe = popen ("gnuplot -persistent", "w");
int i;
for (i=0; i < NUM_POINTS; i++)
{
fprintf(temp1, "%lf %lf \n", x1vals[i] , y1vals[i]); //Write the data to a temporary file
}
for (i=0; i < NUM_COMMANDS; i++)
{
fprintf(gnuplotPipe, "%s \n", commandsForGnuplot[i]); //Send commands to gnuplot one by one.
fflush(gnuplotPipe);
}
for (int i=0;i<10;i++)
{
std::cout<<i<<std::endl;
sleep(1.0);
}
return 0;
}
WARNING:
plot [0:3][0:10] 'data1.temp' with linespoints lc rgb 'red'
line 0: warning: Skipping data file with no valid points
What does it means??????
[toc] | [prev] | [next] | [standalone]
| From | Ethan A Merritt <sfeam@users.sourceforge.net> |
|---|---|
| Date | 2015-10-12 16:30 -0700 |
| Message-ID | <mvhfmh$qdj$1@dont-email.me> |
| In reply to | #3103 |
Marcello Chiurazzi wrote:
> I have a problem using gnupolot from a c++ source code.
> The error is this:line 0: warning: Skipping data file with no valid points
>
> The code is this:
> char * commandsForGnuplot[] = {"set title \"ThumbRest\"","plot
> [0:6][-8.0:8.0] 'Thumb_R_1' with linespoints lc rgb 'black', 'Thumb_R_2'
> with linespoints lc rgb 'green', 'Thumb_R_3' with linespoints lc rgb
> 'blue', 'Thumb_R_4' with linespoints lc rgb 'red'"};
>
> for (int l=0;l<NUM_POINTS;l++)
> {
> xvals[l]=((6)*(l+1))/(double)NUM_POINTS;
> }
> FILE * temp1 = fopen("Thumb_R_1", "w");
> FILE * temp2 = fopen("Thumb_R_2", "w");
> FILE * temp3 = fopen("Thumb_R_3", "w");
> FILE * temp4 = fopen("Thumb_R_4", "w");
> /*Opens an interface that one can use to send
> commands as if they were typing into the
> * gnuplot command line. "The -persistent"
> keeps the plot open even after your
> * C program terminates.
> */
> FILE * gnuplotPipe = popen ("gnuplot -persistent",
> "w"); int i;
> for (i=0; i < NUM_POINTS; i++)
> {
> fprintf(temp1, "%g %g \n", xvals[i] ,
> position_4f[4*i]); //Write the data to a
> temporary file fprintf(temp2, "%g %g \n",
> xvals[i] , position_4f[1+4*i]); //Write the data
> to a temporary file fprintf(temp3, "%g %g \n",
> xvals[i] , position_4f[2+4*i]); //Write the data
> to a temporary file fprintf(temp4, "%g %g \n",
> xvals[i] , position_4f[3+4*i]); //Write the data
> to a temporary file
> }
> for (i=0; i < NUM_COMMANDS; i++)
> {
> fprintf(gnuplotPipe, "%s \n",
> commandsForGnuplot[i]); //Send commands to gnuplot
> one by one. }
>
> The plot is a traiectory followed by a robot,this traiectory is randomic
> because i set the pose to reach and the system define the traiectory,so
> the error is randomic too(sometimes i have it,sometimes no). I would like
> to understand what is this error(warning).
I suspect it would be a good idea to close your temp files before trying
to read them from another program (in this case gnuplot).
On the other hand, maybe one of your files really is empty?
Ethan
[toc] | [prev] | [next] | [standalone]
| From | Marcello Chiurazzi <chiurazzi.marcello@gmail.com> |
|---|---|
| Date | 2015-10-13 00:33 -0700 |
| Message-ID | <a8ac1eb0-1d87-433a-9d30-ae2f101672b1@googlegroups.com> |
| In reply to | #3106 |
Il giorno martedì 13 ottobre 2015 01:30:24 UTC+2, Ethan A Merritt ha scritto:
> Marcello Chiurazzi wrote:
>
> > I have a problem using gnupolot from a c++ source code.
> > The error is this:line 0: warning: Skipping data file with no valid points
> >
> > The code is this:
> > char * commandsForGnuplot[] = {"set title \"ThumbRest\"","plot
> > [0:6][-8.0:8.0] 'Thumb_R_1' with linespoints lc rgb 'black', 'Thumb_R_2'
> > with linespoints lc rgb 'green', 'Thumb_R_3' with linespoints lc rgb
> > 'blue', 'Thumb_R_4' with linespoints lc rgb 'red'"};
> >
> > for (int l=0;l<NUM_POINTS;l++)
> > {
> > xvals[l]=((6)*(l+1))/(double)NUM_POINTS;
> > }
> > FILE * temp1 = fopen("Thumb_R_1", "w");
> > FILE * temp2 = fopen("Thumb_R_2", "w");
> > FILE * temp3 = fopen("Thumb_R_3", "w");
> > FILE * temp4 = fopen("Thumb_R_4", "w");
> > /*Opens an interface that one can use to send
> > commands as if they were typing into the
> > * gnuplot command line. "The -persistent"
> > keeps the plot open even after your
> > * C program terminates.
> > */
> > FILE * gnuplotPipe = popen ("gnuplot -persistent",
> > "w"); int i;
> > for (i=0; i < NUM_POINTS; i++)
> > {
> > fprintf(temp1, "%g %g \n", xvals[i] ,
> > position_4f[4*i]); //Write the data to a
> > temporary file fprintf(temp2, "%g %g \n",
> > xvals[i] , position_4f[1+4*i]); //Write the data
> > to a temporary file fprintf(temp3, "%g %g \n",
> > xvals[i] , position_4f[2+4*i]); //Write the data
> > to a temporary file fprintf(temp4, "%g %g \n",
> > xvals[i] , position_4f[3+4*i]); //Write the data
> > to a temporary file
> > }
> > for (i=0; i < NUM_COMMANDS; i++)
> > {
> > fprintf(gnuplotPipe, "%s \n",
> > commandsForGnuplot[i]); //Send commands to gnuplot
> > one by one. }
> >
> > The plot is a traiectory followed by a robot,this traiectory is randomic
> > because i set the pose to reach and the system define the traiectory,so
> > the error is randomic too(sometimes i have it,sometimes no). I would like
> > to understand what is this error(warning).
>
> I suspect it would be a good idea to close your temp files before trying
> to read them from another program (in this case gnuplot).
>
> On the other hand, maybe one of your files really is empty?
>
> Ethan
In this case what happen is that the plot appears during the execution but it is completely white and i have this warning,but when the program ends the points appears on the plot.So at the end of the program i can have the correct plot but during the execution the plot window is completely white.
I read your answer but how i should close my temp file?
[toc] | [prev] | [next] | [standalone]
| From | Marcello Chiurazzi <chiurazzi.marcello@gmail.com> |
|---|---|
| Date | 2015-10-13 00:42 -0700 |
| Message-ID | <84ec2215-feb7-44f7-8fdb-bdbbf21faa88@googlegroups.com> |
| In reply to | #3107 |
Il giorno martedì 13 ottobre 2015 09:33:20 UTC+2, Marcello Chiurazzi ha scritto:
> Il giorno martedì 13 ottobre 2015 01:30:24 UTC+2, Ethan A Merritt ha scritto:
> > Marcello Chiurazzi wrote:
> >
> > > I have a problem using gnupolot from a c++ source code.
> > > The error is this:line 0: warning: Skipping data file with no valid points
> > >
> > > The code is this:
> > > char * commandsForGnuplot[] = {"set title \"ThumbRest\"","plot
> > > [0:6][-8.0:8.0] 'Thumb_R_1' with linespoints lc rgb 'black', 'Thumb_R_2'
> > > with linespoints lc rgb 'green', 'Thumb_R_3' with linespoints lc rgb
> > > 'blue', 'Thumb_R_4' with linespoints lc rgb 'red'"};
> > >
> > > for (int l=0;l<NUM_POINTS;l++)
> > > {
> > > xvals[l]=((6)*(l+1))/(double)NUM_POINTS;
> > > }
> > > FILE * temp1 = fopen("Thumb_R_1", "w");
> > > FILE * temp2 = fopen("Thumb_R_2", "w");
> > > FILE * temp3 = fopen("Thumb_R_3", "w");
> > > FILE * temp4 = fopen("Thumb_R_4", "w");
> > > /*Opens an interface that one can use to send
> > > commands as if they were typing into the
> > > * gnuplot command line. "The -persistent"
> > > keeps the plot open even after your
> > > * C program terminates.
> > > */
> > > FILE * gnuplotPipe = popen ("gnuplot -persistent",
> > > "w"); int i;
> > > for (i=0; i < NUM_POINTS; i++)
> > > {
> > > fprintf(temp1, "%g %g \n", xvals[i] ,
> > > position_4f[4*i]); //Write the data to a
> > > temporary file fprintf(temp2, "%g %g \n",
> > > xvals[i] , position_4f[1+4*i]); //Write the data
> > > to a temporary file fprintf(temp3, "%g %g \n",
> > > xvals[i] , position_4f[2+4*i]); //Write the data
> > > to a temporary file fprintf(temp4, "%g %g \n",
> > > xvals[i] , position_4f[3+4*i]); //Write the data
> > > to a temporary file
> > > }
> > > for (i=0; i < NUM_COMMANDS; i++)
> > > {
> > > fprintf(gnuplotPipe, "%s \n",
> > > commandsForGnuplot[i]); //Send commands to gnuplot
> > > one by one. }
> > >
> > > The plot is a traiectory followed by a robot,this traiectory is randomic
> > > because i set the pose to reach and the system define the traiectory,so
> > > the error is randomic too(sometimes i have it,sometimes no). I would like
> > > to understand what is this error(warning).
> >
> > I suspect it would be a good idea to close your temp files before trying
> > to read them from another program (in this case gnuplot).
> >
> > On the other hand, maybe one of your files really is empty?
> >
> > Ethan
>
> In this case what happen is that the plot appears during the execution but it is completely white and i have this warning,but when the program ends the points appears on the plot.So at the end of the program i can have the correct plot but during the execution the plot window is completely white.
>
> I read your answer but how i should close my temp file?
I ditit,the problem was the temp file.i closed it and now it works.thank you Ethan
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web