source: trunk/Jgraph/sin1.jgr@ 436

Last change on this file since 436 was 418, checked in by Nicholas Riley, 17 years ago

Jgraph 8.3 from http://www.cs.utk.edu/~plank/plank/jgraph/jgraph.tar.gz

File size: 1.1 KB
Line 
1(* This is an extension of sin.jgr only this time, the axes are at
2x = 0 and y = 0. The hash labels are printed at the left and bottom. *)
3
4newgraph
5
6yaxis min -1 max 1 label : sin(i)
7 no_draw_hash_marks no_draw_axis_line
8
9xaxis min -10 max 10 label : i
10 no_draw_hash_marks no_draw_axis_line
11
12(* Plot the sin curve *)
13curve 1
14 marktype none
15 linetype solid
16 pts include sin.pts
17 (* sin.pts was created by the following c program:
18
19 #include <math.h>
20 main();
21 {
22 double x;
23 for (x = -10.0; x < 10.0; x += .03)
24 printf("%f %f\n", x, sin(x));
25 }
26
27 *)
28
29(* Now, create a new graph with the same dimensions, but with the
30 * x & y axes in a different place, and with no axis or hash labels.
31 * Also, make the hash marks smaller. *)
32
33newgraph
34inherit_axes
35xaxis draw draw_at 0 hash_scale -.5 no_draw_hash_labels no_draw_axis_label
36yaxis draw draw_at 0 hash_scale -.5 no_draw_hash_labels no_draw_axis_label
37
38(* Finally, we want the hash marks to be centered around the axes,
39 * so draw them again with a scaling of +5.
40 *)
41
42newgraph
43inherit_axes
44xaxis hash_scale .5
45yaxis hash_scale .5
46
Note: See TracBrowser for help on using the repository browser.