1 | <?xml version="1.0" encoding="iso-8859-1"?> |
---|
2 | <xsl:stylesheet |
---|
3 | version="1.0" |
---|
4 | xmlns:d="http://docbook.org/ns/docbook" |
---|
5 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
---|
6 | |
---|
7 | <!--rst |
---|
8 | |
---|
9 | .. _year_gnuplot.xsl: |
---|
10 | |
---|
11 | ================ |
---|
12 | year_gnuplot.xsl |
---|
13 | ================ |
---|
14 | |
---|
15 | DESCRIPTION |
---|
16 | =========== |
---|
17 | |
---|
18 | production d'un fichier de commande gnuplot avec données incorporées pour |
---|
19 | le graphe publications/année |
---|
20 | |
---|
21 | TODO |
---|
22 | ==== |
---|
23 | |
---|
24 | understand message "avoid all points y value undefined" |
---|
25 | when this line is process:: |
---|
26 | |
---|
27 | set xrange [<xsl:value-of select="$yyyy_min"/>:<xsl:value-of select="$yyyy_max"/>] |
---|
28 | |
---|
29 | EVOLUTIONS |
---|
30 | ========== |
---|
31 | |
---|
32 | $Id$ |
---|
33 | |
---|
34 | $URL$ |
---|
35 | |
---|
36 | - fplod 20120228 |
---|
37 | |
---|
38 | * rewrite ReST header |
---|
39 | * remove svg stuff |
---|
40 | * add min and max year computation thanks to |
---|
41 | http://www.dpawson.co.uk/xsl/sect2/N5121.html#d6617e433 max(), min() and avg() functions |
---|
42 | but not used because of gnuplot issue |
---|
43 | |
---|
44 | - fplod 2008-04-30T06:50:45Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
45 | |
---|
46 | * chgt for dbk5 in |
---|
47 | |
---|
48 | - fplod 2007-05-21T12:52:07Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
49 | |
---|
50 | * creation |
---|
51 | d'après /Users/pinsard/ES/src/estimation/src/estimation_graph1_gnuplot.xsl |
---|
52 | |
---|
53 | --> |
---|
54 | |
---|
55 | <xsl:output |
---|
56 | method="text" |
---|
57 | encoding="ISO-8859-1" |
---|
58 | indent="yes"/> |
---|
59 | |
---|
60 | <xsl:include href="biblioentry_xml.xsl"/> |
---|
61 | |
---|
62 | <xsl:variable name="list_years" select="///d:pubdate[not( self::node() = following::d:pubdate )]"/> |
---|
63 | |
---|
64 | <xsl:variable name="yyyy_max"> |
---|
65 | <xsl:for-each select="$list_years"> |
---|
66 | <xsl:sort data-type="number" order="descending"/> |
---|
67 | <xsl:if test="position()=1"> |
---|
68 | <xsl:value-of select="."/> |
---|
69 | </xsl:if> |
---|
70 | </xsl:for-each> |
---|
71 | </xsl:variable> |
---|
72 | |
---|
73 | <xsl:variable name="yyyy_min"> |
---|
74 | <xsl:for-each select="$list_years"> |
---|
75 | <xsl:sort data-type="number" order="ascending"/> |
---|
76 | <xsl:if test="position()=1"> |
---|
77 | <xsl:value-of select="."/> |
---|
78 | </xsl:if> |
---|
79 | </xsl:for-each> |
---|
80 | </xsl:variable> |
---|
81 | |
---|
82 | <xsl:template match="d:bibliography"> |
---|
83 | #+ |
---|
84 | # .. _years_gnuplot.gnu: |
---|
85 | # |
---|
86 | # DESCRIPTION |
---|
87 | # =========== |
---|
88 | # |
---|
89 | # EXAMPLES |
---|
90 | # ======== |
---|
91 | # |
---|
92 | # :: |
---|
93 | # |
---|
94 | # $ gnuplot years_gnuplot.gnu |
---|
95 | # |
---|
96 | # EVOLUTIONS |
---|
97 | # =========== |
---|
98 | # |
---|
99 | # - <xsl:value-of select="$makedate"/> |
---|
100 | # |
---|
101 | # * created by :ref:`years_gnuplot.xsl` |
---|
102 | # |
---|
103 | #- |
---|
104 | reset |
---|
105 | # |
---|
106 | # codage iso pour les diacritiques |
---|
107 | set encoding iso_8859_1 |
---|
108 | # |
---|
109 | set size 1.0, 1.0 |
---|
110 | set origin 0.0, 0.0 |
---|
111 | # |
---|
112 | # pas de légendes |
---|
113 | set nokey |
---|
114 | # |
---|
115 | # definition of axes |
---|
116 | set xlabel "Year" |
---|
117 | set xdata time |
---|
118 | set timefmt "%Y" |
---|
119 | set format x "%Y" |
---|
120 | #set xrange [<xsl:value-of select="$yyyy_min"/>:<xsl:value-of select="$yyyy_max"/>] # commented to understand message "avoid all points y value undefined" |
---|
121 | set xrange [*:*] |
---|
122 | set yrange [*:*] |
---|
123 | set ylabel "Nb of publications" |
---|
124 | # titre sur le graphique |
---|
125 | set title "nb of publications by year date : <xsl:value-of select="$makedate"/>" |
---|
126 | # |
---|
127 | set term png |
---|
128 | set output "<xsl:value-of select="$path"/>/years.png" |
---|
129 | |
---|
130 | plot '-' using 1:2 with lines |
---|
131 | <!-- loop on years --> |
---|
132 | <xsl:for-each select="$list_years"> |
---|
133 | <xsl:sort order="ascending" data-type="number" select="."/> |
---|
134 | <xsl:call-template name="one_year"> |
---|
135 | <xsl:with-param name="year" select="."/> |
---|
136 | </xsl:call-template> |
---|
137 | </xsl:for-each> |
---|
138 | <xsl:text>e</xsl:text> |
---|
139 | <xsl:text>
</xsl:text> |
---|
140 | </xsl:template> |
---|
141 | |
---|
142 | <xsl:template name="one_yearcount"> |
---|
143 | <xsl:param name="year"/> |
---|
144 | <xsl:value-of select="count(/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$year]]) "/> |
---|
145 | <xsl:text> </xsl:text> |
---|
146 | </xsl:template> |
---|
147 | |
---|
148 | <xsl:template name="one_year"> |
---|
149 | <xsl:param name="year"/> |
---|
150 | <xsl:value-of select="$year"/> |
---|
151 | <xsl:text> </xsl:text> |
---|
152 | <xsl:value-of select="count(/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$year]]) "/> |
---|
153 | <xsl:text>
</xsl:text> |
---|
154 | </xsl:template> |
---|
155 | |
---|
156 | </xsl:stylesheet> |
---|