Index: /trunk/makefile
===================================================================
--- /trunk/makefile	(revision 148)
+++ /trunk/makefile	(revision 149)
@@ -1,3 +1,7 @@
-# module :
+#+
+#
+# DESCRIPTION
+# ===========
+#
 # génération des pages superbib
 #
@@ -68,4 +72,5 @@
 # creation
 #
+#-
 PRODUCT = \
 superbib
@@ -484,6 +489,20 @@
 
 $(DIRWWW)/images/years.png : \
-$(DIRTMP)/years.ploticus
-	@pl -o $@ png $<
+$(DIRTMP)/years.ploticus \
+$(DIRTMP)/years_gnuplot.gnu
+	@gnuplot years_gnuplot.gnu
+	@pl -o $@ png $<	
+
+$(DIRTMP)/years_gnuplot.gnu : \
+$(DIRTMP)/biblio.xml \
+$(DIRSRC)/years_gnuplot.xsl \
+$(DIRSRC)/biblioentry_xml.xsl \
+$(DIRSRC)/message_lang.xsl
+	@xsltproc \
+	--param makedate "'$(MAKEDATE)'" \
+	--param path "'$(DIRTMP)'" \
+	--output $@ \
+	$(DIRSRC)/years_gnuplot.xsl \
+	$<
 
 $(DIRTMP)/years.ploticus : \
Index: /trunk/years_gnuplot.xsl
===================================================================
--- /trunk/years_gnuplot.xsl	(revision 148)
+++ /trunk/years_gnuplot.xsl	(revision 149)
@@ -6,15 +6,44 @@
 
 <!--
-module :
+.. _year_gnuplot.xsl:
+
+DESCRIPTION
+===========
+
 production d'un fichier de commande gnuplot avec données incorporées pour
 le graphe publications/année
 
-update :
+TODO
+====
+
+understand message "avoid all points y value undefined"
+when this line is process::
+
+  set xrange [<xsl:value-of select="$yyyy_min"/>:<xsl:value-of select="$yyyy_max"/>]
+
+EVOLUTIONS
+==========
+
 $Id$
-fplod 2008-04-30T06:50:45Z aedon.locean-ipsl.upmc.fr (Darwin)
-chgt for dbk5 in
-fplod 2007-05-21T12:52:07Z aedon.locean-ipsl.upmc.fr (Darwin)
-d'après /Users/pinsard/ES/src/estimation/src/estimation_graph1_gnuplot.xsl
-creation
+
+$URL$
+
+- fplod 20120228
+
+  * rewrite ReST header
+  * remove svg stuff
+  * add min and max year computation thanks to
+    http://www.dpawson.co.uk/xsl/sect2/N5121.html#d6617e433 max(), min() and avg() functions
+    but not used because of gnuplot issue
+
+- fplod 2008-04-30T06:50:45Z aedon.locean-ipsl.upmc.fr (Darwin)
+
+  * chgt for dbk5 in
+
+- fplod 2007-05-21T12:52:07Z aedon.locean-ipsl.upmc.fr (Darwin)
+
+  * creation
+    d'après /Users/pinsard/ES/src/estimation/src/estimation_graph1_gnuplot.xsl
+
 -->
 
@@ -28,14 +57,44 @@
 <xsl:variable name="list_years" select="///d:pubdate[not( self::node() = following::d:pubdate )]"/>
 
+<xsl:variable name="yyyy_max">
+     <xsl:for-each select="$list_years">
+       <xsl:sort data-type="number" order="descending"/>
+       <xsl:if test="position()=1">
+	  <xsl:value-of select="."/>
+       </xsl:if>
+     </xsl:for-each>
+</xsl:variable>
+
+<xsl:variable name="yyyy_min">
+     <xsl:for-each select="$list_years">
+       <xsl:sort data-type="number" order="ascending"/>
+       <xsl:if test="position()=1">
+	  <xsl:value-of select="."/>
+       </xsl:if>
+     </xsl:for-each>
+</xsl:variable>
+
 <xsl:template match="d:bibliography">
+#+
+# .. _years_gnuplot.gnu:
 #
-#  $ gnuplot graph1_<xsl:value-of select="years"/>.gnu
+# DESCRIPTION
+# ===========
 #
-# source :
-# ++/graph1_<xsl:value-of select="years"/>.gnu
+# EXAMPLES
+# ========
 #
-# update :
-# <xsl:value-of select="$makedate"/>
+# :: 
 #
+#  $ gnuplot years_gnuplot.gnu
+#
+# EVOLUTIONS
+# ===========
+#
+# - <xsl:value-of select="$makedate"/>
+#
+#   * created by :ref:`years_gnuplot.xsl`
+#
+#-
 reset
 #
@@ -54,16 +113,15 @@
 set timefmt "%Y"
 set format x "%Y"
-#++set xrange ++ year min year max
+#set xrange [<xsl:value-of select="$yyyy_min"/>:<xsl:value-of select="$yyyy_max"/>] # commented to understand message "avoid all points y value undefined"
+set xrange [*:*]
+set yrange [*:*]
 set ylabel "Nb of publications"
 # titre sur le graphique
 set title "nb of publications by year date : <xsl:value-of select="$makedate"/>"
 #
-#set term svg dynamic
-#set output "years.svg"
-#++set output "fichier_svg"
 set term png
 set output "<xsl:value-of select="$path"/>/years.png"
 
-plot '-' using 1:2 with linespoints
+plot '-' using 1:2 with lines
    <!-- loop on years -->
    <xsl:for-each select="$list_years">
@@ -77,4 +135,10 @@
 </xsl:template>
 
+<xsl:template name="one_yearcount">
+<xsl:param name="year"/>
+<xsl:value-of select="count(/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$year]]) "/>
+<xsl:text> </xsl:text>
+</xsl:template>
+
 <xsl:template name="one_year">
 <xsl:param name="year"/>
