File: plotting.xp

package info (click to toggle)
epix 1.2.22-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,256 kB
  • sloc: cpp: 16,847; sh: 5,054; makefile: 159; lisp: 6
file content (26 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* -*-ePiX-*- */
#include "epix.h"
using namespace ePiX;

double f(double x)
{
  return 0.75*Sin(x) - 0.25*Sin(2*x);
}

int main()
{
  picture(P(-2,-1),P(2,1), "5x1in");

  begin();

  h_axis(16);
  v_axis(4);

  h_axis_labels(4, P(0,-4), b); // shift labels down 4pt, align below

  revolutions(); // set angle units
  red();
  plot(f, xmin(), xmax(), 120); // use 120 intervals

  end();
}