charts - Gnuplot does not plot negative values -
charts - Gnuplot does not plot negative values -
data file bipdeutschland.csv:
1991 79.09 0 1992 80.61 1.9 1993 79.84 –1.0 1994 81.8 2.5 1995 83.19 1.7 1996 83.84 0.8 1997 85.37 1.8 1998 87.05 2 1999 88.78 2 2000 91.43 3 2001 92.98 1.7 2002 92.99 0 2003 92.32 –0.7 2004 93.41 1.2 2005 94.07 0.7 2006 97.56 3.7 2007 100.75 3.3 2008 101.81 1.1 2009 96.07 –5.6 2010 100.00 4.1 2011 103.59 3.6 2012 103.98 0.4 2013 104.09 0.1 2014 105.76 1.6
plt file:
set xdata time set timefmt "%y" set format x "%y" set format y "%6.0f" set xrange ["1990":"2015"] set yrange [0:120] set style fill solid 1.0 set boxwidth 0.85 relative set xlabel "jahr" set ylabel "reales bruttoinlandsprodukt (2010=100%)" set y2range [-5:5] set y2label "veränderung des bruttoinlandsprodukts zum vorjahr (in %)" set y2tics 2 set ytics nomirror set xtics nomirror set output "bipdeutschland.png" set term png size 1000, 500 plot "bipdeutschland.csv" using 1:2 title '' w boxes lc rgb "green", "bipdeutschland.csv" using 1:3 title '' lines lw 4 lc rgb "red" axes x1y2;
the reddish line should in negative range 1993, 2003 , 2009, isn't. problem, gnuplot fails parse input file or code wrong?
your info file wrong. if closely @ output see, points negative values skipped.
the problem is, instead of having minus sign (u+002d), have en-dash (u+2013), gnuplot fails parse negative numbers, since aren't numbers.
using following, corrected info file
1991 79.09 0 1992 80.61 1.9 1993 79.84 -1.0 1994 81.8 2.5 1995 83.19 1.7 1996 83.84 0.8 1997 85.37 1.8 1998 87.05 2 1999 88.78 2 2000 91.43 3 2001 92.98 1.7 2002 92.99 0 2003 92.32 -0.7 2004 93.41 1.2 2005 94.07 0.7 2006 97.56 3.7 2007 100.75 3.3 2008 101.81 1.1 2009 96.07 -5.6 2010 100.00 4.1 2011 103.59 3.6 2012 103.98 0.4 2013 104.09 0.1 2014 105.76 1.6
does give right output using script:
charts gnuplot
Comments
Post a Comment