manpagez: man pages & more
info mathgl_en
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.5.10 Cones sample

Function cones is similar to Bars but draw cones. The sample code is:

int sample(mglGraph *gr)
{
  mglData ys(10,3);   ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd");
  gr->Light(true);    gr->SetOrigin(0,0,0);
  gr->SubPlot(3,2,0); gr->Title("Cones plot");
  gr->Rotate(50,60);  gr->Box();  gr->Cones(ys);

  gr->SubPlot(3,2,1); gr->Title("2 colors");
  gr->Rotate(50,60);  gr->Box();  gr->Cones(ys,"cbgGyr");

  gr->SubPlot(3,2,2); gr->Title("'#' style");
  gr->Rotate(50,60);  gr->Box();  gr->Cones(ys,"#");

  gr->SubPlot(3,2,3); gr->Title("'a' style");
  gr->SetRange('z',-2,2); // increase range since summation can exceed [-1,1]
  gr->Rotate(50,60);  gr->Box();  gr->Cones(ys,"a");

  gr->SubPlot(3,2,4); gr->Title("'t' style");
  gr->Rotate(50,60);  gr->Box();  gr->Cones(ys,"t");

  gr->SubPlot(3,2,5); gr->Title("'4' style");
  gr->Rotate(50,60);  gr->Box();  gr->Cones(ys,"4");
  return 0;
}
Example of Cones()

This document was generated on March 21, 2014 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.