Advertisement
ktv6

Gnuplot label points

Dec 10th, 2019
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1. void plotStudyIteration(FILE *gPipe, vector<WTANeuron> &Neurons, point2* studyMass, int studyMassSize) {
  2.     register int i;
  3.     fprintf(gPipe, "unset multiplot\nset multiplot\n");
  4.     fprintf(gPipe, "plot '-' u 1:2:3 w labels\n");
  5.     for(i=0; i<Neurons.size(); ++i) {
  6.         fprintf(gPipe, "%lf %lf %d\n", Neurons[i].w[0], Neurons[i].w[1], Neurons[i].index);
  7.     }
  8.     fprintf(gPipe, "e\n");
  9.     fprintf(gPipe, "plot '-' u 1:2 w points ls 0\n");
  10.     for(i=0; i<studyMassSize; ++i) {
  11.         // if(studyMass[i].outValue == 0) {
  12.         //     fprintf(gPipe, "plot '-' u 1:2 w points ls 1\n");
  13.         // }
  14.         // if(studyMass[i].outValue == 1) {
  15.         //     fprintf(gPipe, "plot '-' u 1:2 w points ls 5\n");
  16.         // }
  17.         // if(studyMass[i].outValue == 2) {
  18.         //     fprintf(gPipe, "plot '-' u 1:2 w points ls 7\n");
  19.         // }
  20.         fprintf(gPipe, "%lf\t%lf\n", studyMass[i].x, studyMass[i].y);
  21.  
  22.         // fprintf(gPipe, "e\n");
  23.     }
  24.     fprintf(gPipe, "e\n");
  25.     fflush(gPipe);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement