1 /* @source treetypedisplay application
2 **
3 ** Plot wobble base percentage
4 **
5 ** @author Copyright (C) Ian Longden
6 ** @@
7 **
8 ** This program is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU General Public License
10 ** as published by the Free Software Foundation; either version 2
11 ** of the License, or (at your option) any later version.
12 **
13 ** This program is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ** GNU General Public License for more details.
17 **
18 ** You should have received a copy of the GNU General Public License
19 ** along with this program; if not, write to the Free Software
20 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 ******************************************************************************/
22 
23 #include "emboss.h"
24 
25 
26 
27 
28 /* @prog treetypedisplay ******************************************************
29 **
30 ** Testing graphics
31 **
32 ******************************************************************************/
33 
main(int argc,char ** argv)34 int main(int argc, char **argv)
35 {
36     PLFLT x1[9]=
37     {
38 	2,1,2,1,1,2,3,3
39     };	/* x1,y1  x2,y2  are lines */
40     PLFLT y1[9]=
41     {
42 	4,2,3,1,1,3,2,2
43     };
44     PLFLT x2[9]=
45     {
46 	2,1,1,0,2,3,4,3
47     };
48     PLFLT y2[9]=
49     {
50 	3,1,2,0,0,2,2,1
51     };
52     PLFLT pt1[9]=
53     {
54 	2,1,3,4,1,3,0,2,2
55     };	/* pt1,pt1    are pts */
56     PLFLT pt2[9]=
57     {
58 	4,2,2,2,1,1,0,0,3
59     };
60     ajint i;
61     char temp[7];
62     float xmin = -1.0;
63     float xmax = 5.0;
64     float ymin = -1.0;
65     float ymax = 5.0;
66     AjPGraph graph;
67 
68     embInit("treetypedisplay", argc, argv);
69     graph = ajAcdGetGraph("graph");
70 
71     ajGraphOpenWin(graph, xmin,xmax,ymin,ymax);
72     ajGraphicsDrawsetLines(8,x1,y1,x2,y2);
73     ajGraphicsDrawsetDots(9,pt1,pt2);
74     i = 0;
75 
76     for(i=0;i<8;i++)
77     {
78 	sprintf(temp,"line %d",i);
79 	ajGraphicsDrawposTextAtlineJustify(x1[i], y1[i], x2[i], y2[i],
80                                            temp, 1.0);
81     }
82 
83     ajGraphicsClose();
84     ajGraphxyDel(&graph);
85 
86     embExit();
87 
88     return 0;
89 }
90