Mercurial > octave
annotate scripts/testfun/private/html_compare_plot_demos.m @ 22323:bac0d6f07a3e
maint: Update copyright notices for 2016.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 17 Aug 2016 01:05:19 -0400 |
parents | 3f8ed6d7cb1c |
children | 3a2b891d0b33 fdf9f98c3b72 |
rev | line source |
---|---|
22323
bac0d6f07a3e
maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents:
22126
diff
changeset
|
1 ## Copyright (C) 2010-2016 Ben Abbott |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
2 ## |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
4 ## |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
8 ## your option) any later version. |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
9 ## |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
13 ## General Public License for more details. |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
14 ## |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
18 |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20778
diff
changeset
|
20 ## @deftypefn {} {} html_compare (@var{toolkits}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20778
diff
changeset
|
21 ## @deftypefnx {} {} html_compare (@var{toolkits}, @var{name}, @var{value}, @dots{}) |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
22 ## |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
23 ## Produces an html document to compare the plot demos produced by |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
24 ## @var{toolkits}. |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
25 ## |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
26 ## Valid property names, and their defaults, are: |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
27 ## |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
28 ## @table @samp |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
29 ## @item fmt |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
30 ## @code{"png"} |
19152
0f9c5a15c8fa
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
18925
diff
changeset
|
31 ## |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
32 ## @item output |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
33 ## @code{"compare_plot_demos.html"} |
19152
0f9c5a15c8fa
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
18925
diff
changeset
|
34 ## |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
35 ## @item template |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
36 ## @code{"html_plot_demos_template.html"} |
19152
0f9c5a15c8fa
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
18925
diff
changeset
|
37 ## |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
38 ## @item column_width |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
39 ## @code{600} |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
40 ## @end table |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
41 ## |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
42 ## The template parameter refers to a specially formatted html file |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
43 ## which accompanies this m-file script. |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
44 ## |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
45 ## Additional toolkit description can be added to the column header |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
46 ## with a parameter named equal to the toolkit. For example: |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
47 ## |
19833
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19152
diff
changeset
|
48 ## @smallexample |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19152
diff
changeset
|
49 ## @code{html_compare_plot_demos ({"gnuplot", "fltk"}, "gnuplot", " 4.6 patchlevel 5")} |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19152
diff
changeset
|
50 ## @end smallexample |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
51 ## |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
52 ## @seealso{compare_plot_demos, dump_demos, demo} |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
53 ## @end deftypefn |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
54 |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
55 ## Author: Ben Abbott <bpabbott@mac.com> |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
56 |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
57 function html_compare_plot_demos (toolkits, varargin) |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
58 |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
59 ## Set defaults |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
60 in.fmt = "png"; |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
61 in.figfiles = {}; |
22126
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
62 in.output_fmt = @(p) sprintf ("compare_plot_demos_%02i.html", p); |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
63 in.template = "html_plot_demos_template.html"; |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
64 in.column_width = 600; |
22126
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
65 in.plots_per_page = 50; |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
66 |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
67 ## Parse inputs |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
68 for n = 1:2:numel(varargin) |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
69 in.(lower(varargin{n})) = varargin{n+1}; |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
70 endfor |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
71 |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
72 ## Compile a list of all files for all toolkits |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
73 for t = 1:numel(toolkits) |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
74 filter = sprintf ("%s/*.%s", toolkits{t}, in.fmt); |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
75 in.figfiles = union (in.figfiles, {dir(filter).name}); |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
76 endfor |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
77 |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
78 fid = fopen (which (in.template), "r"); |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
79 template = char (fread (fid)) .'; |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
80 fclose (fid); |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
81 |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
82 anchor = "<!-- ##ADD TABLE HERE## -->"; |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
83 n = findstr (template, anchor); |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
84 header = template(1:n-1); |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
85 trailer = template(n+numel(anchor):end); |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
86 |
22126
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
87 page = 1; |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
88 do |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
89 start_fig = (page - 1) * in.plots_per_page + 1; |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
90 stop_fig = page * in.plots_per_page; |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
91 last_page = stop_fig > numel (in.figfiles); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
92 if (last_page) |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
93 stop_fig = numel (in.figfiles); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
94 endif |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
95 |
22126
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
96 fid = fopen (in.output_fmt (page), "w"); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
97 unwind_protect |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
98 fputs (fid, header); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
99 fprintf (fid, "<p><b>\nGenerated on %s by %s with GNU Octave %s</p>", |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
100 datestr (now (), 0), mfilename, version); |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
101 |
22126
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
102 ## Create page previous/next |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
103 if (page > 1) |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
104 previous_page_link = sprintf ('<a href="%s">previous page</a><br>', in.output_fmt (page - 1)); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
105 else |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
106 previous_page_link = ""; |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
107 endif |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
108 |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
109 if (! last_page) |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
110 next_page_link = sprintf ('<a href="%s">next page</a><br>', in.output_fmt (page + 1)); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
111 else |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
112 next_page_link = ""; |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
113 endif |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
114 |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
115 fprintf (fid, '%s%s<br>', previous_page_link, next_page_link); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
116 |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
117 ## Create table header |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
118 fprintf (fid, "<table border='1'><tr>\n"); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
119 for t = 1:numel(toolkits) |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
120 ## set default |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
121 column_header = upper (toolkits{t}); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
122 if (isfield (in, toolkits{t})) |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
123 column_header = [column_header, in.(toolkits{t})]; |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
124 endif |
22126
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
125 fprintf (fid, '<th>%s <a href="%s/diary.log">diary</a></th>\n', ... |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
126 column_header, toolkits{t}); |
18925
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
127 endfor |
87324260043d
Improve plot comparison scripts.
Andreas Weber <andy.weber.aw@gmail.com>
parents:
18877
diff
changeset
|
128 fprintf (fid, "</tr>\n"); |
22126
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
129 for m = start_fig:stop_fig |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
130 [~, file] = fileparts (in.figfiles{m}); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
131 fn = [file "." in.fmt]; |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
132 fprintf (fid, "<tr id=\"%s\">\n", file); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
133 for k = toolkits |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
134 ffn = fullfile (k{:}, fn); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
135 fprintf (fid, " <td>%s<br>", ffn); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
136 if (exist (ffn, "file")) |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
137 fprintf (fid, "<img src='%s' style='width: %dpx;'>", ... |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
138 ffn, in.column_width); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
139 else |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
140 err_fn = strrep (ffn, ".png", ".err"); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
141 if (! exist (err_fn, "file")) |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
142 warning("File %s doesn't exist...", err_fn); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
143 else |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
144 err_fid = fopen (err_fn); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
145 msg = char (fread (err_fid))'; |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
146 fclose (err_fid); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
147 fprintf (fid, "%s", strrep (msg, "\n", "<br>")); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
148 endif |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
149 endif |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
150 fprintf (fid, "</td>\n"); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
151 endfor |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
152 fprintf (fid, "</tr>\n"); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
153 endfor |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
154 |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
155 fprintf (fid, '</table>\n'); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
156 fprintf (fid, '%s%s<br>', previous_page_link, next_page_link); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
157 |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
158 fputs (fid, trailer); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
159 page++; |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
160 unwind_protect_cleanup |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
161 fclose (fid); |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
162 end_unwind_protect |
3f8ed6d7cb1c
Improve plot comparison in sripts/testfun
Andreas Weber <andy.weber.aw@gmail.com>
parents:
20852
diff
changeset
|
163 until (stop_fig == numel (in.figfiles)) |
18874
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
164 |
c74673161752
Add scripts to help validate plot results.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
165 endfunction |