/[ascend]/trunk/models/plot.a4l
ViewVC logotype

Contents of /trunk/models/plot.a4l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2057 - (show annotations) (download) (as text)
Thu Jun 25 10:27:30 2009 UTC (11 years ago) by jpye
File MIME type: text/x-ascend
File size: 2639 byte(s)
Merging changes changeset 2379 into trunk (accidentally commited to branch).
1 (* ASCEND modelling environment
2 Copyright (C) 1997 Benjamin Andrew Allan
3 Copyright (C) 2007 Carnegie Mellon University
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 *)(*
20 by Ben Allan
21 provoked by plot.a4l by Peter Piela and Kirk A. Abbott
22
23 A parameterized plot library mostly compatible
24 with plot.a4l, but with variable graph titles.
25 *)
26 (* THIS MODEL IS AUTO-INCLUDED IN THE ASCEND MANUAL SO BE CAREFUL WITH EDITS *)
27
28 REQUIRE "atoms.a4l";
29 PROVIDE "plot.a4l";
30
31 MODEL pltmodel() REFINES cmumodel();
32 (* the methods in this MODEL library have
33 basically nothing to do except exist.
34 *)
35 METHODS
36 METHOD check_self;
37 END check_self;
38 METHOD scale_self;
39 END scale_self;
40 METHOD bound_self;
41 END bound_self;
42 METHOD default_all;
43 END default_all;
44 METHOD check_all;
45 END check_all;
46 METHOD bound_all;
47 END bound_all;
48 METHOD scale_all;
49 END scale_all;
50 END pltmodel;
51
52 MODEL plt_point(
53 x WILL_BE real;
54 y WILL_BE real;
55 ) REFINES pltmodel();
56 END plt_point;
57
58
59 MODEL plt_curve(
60 npnts IS_A set OF integer_constant;
61 y_data[npnts] WILL_BE real;
62 x_data[npnts] WILL_BE real;
63 )REFINES pltmodel();
64 (* points of matching subscript will be plotted in order of
65 increasing subscript value.
66 *)
67 legend IS_A symbol;
68 format "colour/linestyle in pylab format, eg 'r-' for red line" IS_A symbol;
69 FOR i IN [npnts] CREATE
70 pnt[i] IS_A plt_point(x_data[i],y_data[i]);
71 END FOR;
72 END plt_curve;
73
74
75 MODEL plt_plot_integer(
76 curve_set IS_A set OF integer_constant;
77 curve[curve_set] WILL_BE plt_curve;
78 )REFINES pltmodel();
79 title, XLabel, YLabel IS_A symbol;
80 Xlow IS_A real;
81 Ylow IS_A real;
82 Xhigh IS_A real;
83 Yhigh IS_A real;
84 Xlog IS_A boolean_start_false;
85 Ylog IS_A boolean_start_false;
86 END plt_plot_integer;
87
88
89 MODEL plt_plot_symbol(
90 curve_set IS_A set OF symbol_constant;
91 curve[curve_set] WILL_BE plt_curve;
92 )REFINES pltmodel();
93 title, XLabel, YLabel IS_A symbol;
94 Xlow IS_A real;
95 Ylow IS_A real;
96 Xhigh IS_A real;
97 Yhigh IS_A real;
98 Xlog IS_A boolean_start_false;
99 Ylog IS_A boolean_start_false;
100 END plt_plot_symbol;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22