File: timetics.sl

package info (click to toggle)
slxfig 0.2.0~.138-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,196 kB
  • sloc: sh: 3,086; ansic: 598; makefile: 265; php: 6
file content (25 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (2)
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
require ("xfig");

public define slsh_main ()
{
   variable wlist = {};
   variable t0 = 1546300800 + 5*3600;
   foreach ([1, 2, 5, 10, 20, 50, 100, 200, 500, 1000])
     {
	variable f = ();
	variable tmax = t0 + 1.2*86400;
	variable tmin = t0 - 1.2*86400*f;

	variable tinfo = xfig_timetics (tmin, tmax; localtime, maxtics=6);
	variable t = [tmin:tmax:#1024];
	variable y = sin(2*PI/(1*86400)*(t-tmin));   % 1 day period
	variable w = xfig_plot_new(20, 2);
	w.plot (t, y; color="blue");
	w.x1axis (;; tinfo); %major=tinfo.major, minor=tinfo.minor, ticlabels=tinfo.ticlabels);
	w.ylabel ("Value");

	list_append (wlist, w);
     }

   xfig_new_vbox_compound (__push_list (wlist), 0.25).render ("timetics.png");
}