Next: , Previous: , Up: 1D samples   [Contents][Index]


3.5.18 Label sample

Function label print text at data points. The string may contain ‘%x’, ‘%y’, ‘%z’ for x-, y-, z-coordinates of points, ‘%n’ for point index. The sample code is:

int sample(mglGraph *gr)
{
  mglData ys(10); ys.Modify("0.8*sin(pi*2*x)+0.2*rnd");
  gr->SubPlot(1,1,0,"");  gr->Title("Label plot");
  gr->Box();  gr->Plot(ys," *");  gr->Label(ys,"y=%y");
  return 0;
}
Example of Label()