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

Contents of /trunk/models/plot.a4l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2651 - (show annotations) (download) (as text)
Thu Dec 13 07:29:48 2012 UTC (11 years, 6 months ago) by jpye
File MIME type: text/x-ascend
File size: 3020 byte(s)
Fixing GPL header, removing postal address (rpmlint incorrect-fsf-address)
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, see <http://www.gnu.org/licenses/>.
17 *)(*
18 by Ben Allan
19 provoked by plot.a4l by Peter Piela and Kirk A. Abbott
20
21 A parameterized plot library mostly compatible
22 with plot.a4l, but with variable graph titles.
23 *)
24 (* THIS MODEL IS AUTO-INCLUDED IN THE ASCEND MANUAL SO BE CAREFUL WITH EDITS *)
25
26 REQUIRE "atoms.a4l";
27 PROVIDE "plot.a4l";
28
29 MODEL pltmodel() REFINES cmumodel();
30 (* the methods in this MODEL library have
31 basically nothing to do except exist.
32 *)
33 METHODS
34 METHOD check_self;
35 END check_self;
36 METHOD scale_self;
37 END scale_self;
38 METHOD bound_self;
39 END bound_self;
40 METHOD default_all;
41 END default_all;
42 METHOD check_all;
43 END check_all;
44 METHOD bound_all;
45 END bound_all;
46 METHOD scale_all;
47 END scale_all;
48 END pltmodel;
49
50 MODEL plt_point(
51 x WILL_BE real;
52 y WILL_BE real;
53 ) REFINES pltmodel();
54 END plt_point;
55
56
57 MODEL plt_curve(
58 npnts IS_A set OF integer_constant;
59 y_data[npnts] WILL_BE real;
60 x_data[npnts] WILL_BE real;
61 )REFINES pltmodel();
62 (* points of matching subscript will be plotted in order of
63 increasing subscript value.
64 *)
65 legend "Label for curve (displayed in legend box)"
66 , format "colour/linestyle in pylab format, eg 'r-' for red line"
67 IS_A symbol;
68 FOR i IN [npnts] CREATE
69 pnt[i] IS_A plt_point(x_data[i],y_data[i]);
70 END FOR;
71 END plt_curve;
72
73 ATOM plt_integer_default_0 REFINES integer
74 DIMENSIONLESS
75 DEFAULT 0;
76 END plt_integer_default_0;
77
78 MODEL plt_plot_integer(
79 curve_set IS_A set OF integer_constant;
80 curve[curve_set] WILL_BE plt_curve;
81 )REFINES pltmodel();
82 title "Plot title (shown at top)"
83 , XLabel "X-axis label"
84 , YLabel "Y-axis label"
85 IS_A symbol;
86 legend_position "Legend position (see http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.legend)"
87 IS_A plt_integer_default_0;
88 Xlow, Ylow, Xhigh, Yhigh IS_A real;
89 Xlog, Ylog IS_A boolean_start_false;
90 END plt_plot_integer;
91
92
93 MODEL plt_plot_symbol(
94 curve_set IS_A set OF symbol_constant;
95 curve[curve_set] WILL_BE plt_curve;
96 )REFINES pltmodel();
97 title "Plot title (shown at top)"
98 , XLabel "X-axis label"
99 , YLabel "Y-axis label"
100 IS_A symbol;
101 legend_position "Legend position (see http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.legend)"
102 IS_A plt_integer_default_0;
103 Xlow, Ylow, Xhigh, Yhigh IS_A real;
104 Xlog, Ylog IS_A boolean_start_false;
105 END plt_plot_symbol;

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